with(require("fs"))readFileSync(0,"utf8").match(/.+/g).map(q=>write(1,+!(`0b${q}001`**.5%1)))