#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< P; // X = {(C+B-1)! * C} / {(C-1)! B!} // Y = {(X+A-1)! * C} / {(X-1)! A!} // X = C * comb(C+B-1, B) // Y = C * comb(X+A-1, A) // parity of combination // Y mod 2 int parity(int n,int k){ if(k<0 || k>n)return 0; if(k==0 || k==n)return 1; if(n%2==0 && k%2==1)return 0; return parity(n/2, k/2); } int main(){ int t; scanf("%d",&t); while(t--){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(c%2==0){ puts("0"); continue; } int x_parity = parity(c+b-1,b); int y_parity = parity(x_parity+a-1,a); printf("%d\n",y_parity); } return 0; }