# WA in "MATXOR"

``````/*
>>       >=>   >=>          >====>         <===>      >==>    >=>
>>=>      >=>  >=>           >=>   >=>    <=>    <=>   >> >=>  >=>
>> >=>     >=> >=>            >=>    >=> <=>        <=> >=> >=> >=>
>=>  >=>    >>=>>      <====>  >=>    >=> <=>        <=> >=>  >=>>=>
>=====>>=>   >=>  >=>           >=>    >=> <=>        <=> >=>   > >=>
>=>      >=>  >=>   >=>          >=>   >=>    <=>     <=>  >=>    >>=>
>=>        >=> >=>     >=>        >====>         <===>      >=>     >=>

Atharva Karandikar
*/

#include <bits/stdc++.h>
#include<algorithm>
#include<vector>
using namespace std;
void solve()
{
long long int i,j,k,cnt=0,cnt1=0,cnt2=0,num,denom,n,A,B,ind=0,sum=0,m,k1,k2,w1,w2,x1,x2,b;
string str;

cin>>n>>m>>k;
if(n>m)
{k=n;
n=m;
m=k;}

{
if((n%2)==0)
{
for(i=1;i<=n/2;i++)
{
sum=sum^(k+i+i);

}
cnt=n/2;
num=m;
denom=n;
while(cnt--)
{
sum=sum^(k+num+denom);

num--;
denom--;
}
}
else
{
for(i=1;i<=n/2;i++)
{
sum=sum^(k+i+i);

}
cnt=n/2;
num=m;
denom=n;
while(cnt--)
{
sum=sum^(k+num+denom);
num--;
denom--;
}
for(i=n/2+1;i<m-n/2;i++)
{
sum=sum^(k+i+n/2+1);
}

}

}
cout<<sum<<endl;

}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc;
cin>>tc;
while(tc--)
{
solve();
}
return 0;
}

``````