#include using namespace std; int main() { std::ios::sync_with_stdio(0); int T; cin >> T; while(T--) { int n; cin >> n; if(n % 2 == 1) cout << "1\n"; else cout << "0\n"; } return 0; }