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