#include using namespace std; bool is_odd_comb(int n, int k) { return (n & k) == k; } int solve(int A, int B, int C) { if (C % 2 == 0) { return 0; } bool cond1 = is_odd_comb(C + A - 1, A); bool cond2 = is_odd_comb(C + B - 1, B); return cond1 && cond2 ? 1 : 0; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while (T--) { int A, B, C; cin >> A >> B >> C; cout << solve(A, B, C) << "\n"; } return 0; }