PERMUT2 not getting

n=int(input())
while (n!=0):
l=list(map(int,input().split()))
r=[0]*n
for i in range(n):
r[l[i]-1]=i+1

if l==r:
    print("ambiguous")
else:
    print("not ambiguous")
    
n=int(input())

could any body say why we have taken n=int(input()) again at down in permut2

because the problem states that input will end when n=0. basically n=0 is the case where you have to terminate you program.

ok tq