#include int main(void) { int T; scanf("%d", &T); while (T -- > 0) { int n; scanf("%d", &n); printf("%d\n", n % 2); } return 0; }