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