#include using namespace std; int N; main() { cin>>N; long ans=0; for(int i=0;i>K>>L>>D; long L2=L>>D; while(K>0&&L2%4) { ans^=L; L+=1<