import java.util.*;enum H{H;System z;int i,k,x,y;{for(Scanner r=new Scanner(z.in);k<2;z.out.println(k))for(i=0;i++<10;k=i>1?0<y&(y&y-1)<1?k:0:1,y=x)y^=x=r.nextInt();}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).