n=int(input()) s=list(map(int,input().split())) t=0 for i in range(n): if s[i]!=i+1: t+=1 if t%4==0 or (2*t+1)%4==0: print (1) else: print (-1)