import java.util.Scanner; public class Main{ static int n; static int[] w; static int[][] dp; static boolean res(int x,int h){ if(h==0) return true; else if(h<0) return false; else if(x==n-1) return false; else if(dp[x][h]!=-1){ if(dp[x][h]==0) return true; else return false; } else{ if(res(x+1,h)||res(x+1,h-w[x])){ dp[x][h]=0; return true; } else{ dp[x][h]=1; return false; } } } public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ n=sc.nextInt(); w=new int[n]; int sum=0; for(int i=0;i