n=int(input()) import math prime=[] s=[1]*(n+1) s[0]=s[1]=0 for i in range(2,n,2): s[i]=0 for i in range(3,int(math.sqrt(n))): for j in range(2,math.ceil(n/i)): if s[i*j]==1: s[i*j]=0 for i in range(n): if s[i]==1: prime.append(i) winlose=[-1]*(n+1) winlose[0],winlose[1]=1,1 for i in range(2,n+1): for j in prime: if i