N=int(input()) A=[] for i in range(N): A.append((1<