import java.util.*; import java.io.*; class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } class Solution { FastReader sc; int t; int prime[]; public Solution() { sc=new FastReader(); t=sc.nextInt(); prime=new int[100004]; prime[0]=1; prime[1]=1; fill(); int arr[]=new int[100004]; Arrays.fill(arr,0); arr[0]=-1; arr[1]=-1; int flag=-1; for(int i=2;i<100002;i++) { if(prime[i]!=0) { arr[i]=flag; } else if(prime[i]==0) { if(flag==-1) { flag=1; } else if(flag==1) { flag=-1; } arr[i]=flag; } } /*for(int i=0;i<30;i++) { System.out.println(i+" "+arr[i]); }*/ for(int z=0;z