#include using namespace std; int main(){ int T; cin>>T; while(T--){ int n; cin>>n; int ans=0; if(n%2 == 1) ans=1; if(n%2 == 0) ans=0; cout<< ans<