n=int(input()) import math prime=[] s=[1]*n s[0]=s[1]=0 for i in range(4,n,2): if s[i]==1: s[i]=0 for i in range(3,int(math.sqrt(n))+1): for j in range(2,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