for i=0:49 g=base2dec(fgetl(stdin),2); disp((8*g+1)**0.5%2==1) endfor