50.times do puts (8*STDIN.gets(8).to_i(2)+1)**0.5%2==1?1:0 end