AC代码:
#include<iostream>
using namespace std;
int main() {
long long n,t;
cin>>t;
while(t--){
cin>>n;
if(n%4==1) {
cout<<"1"<<endl;
}
else if(n%4==2) {
cout<<n+1<<endl;
}
else if(n%4==3) {
cout<<"0"<<endl;
}
else{
cout<<n<<endl;
}
}
return 0;
}