n=int(input()) import math prime=[] s=[1]*(n+1) s[0]=s[1]=0 i=2 while i*i<=n: j=2 while i*j<=n and s[i]!=0: s[i*j]=0 j+=1 i+=1 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