#include using namespace std; #define rep(i,n) for(int i = 0;i<((int)(n));i++) #define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++) #define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--) #define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--) typedef long long ll; /* AC 全てのカードのxorはx */ ll n,k[300010],l[300010],d[300010],ans=0; ll f(ll x){ if(x%4==0)return x; if(x%4==1)return 1; if(x%4==2)return x+1; return 0; } void init(){ cin>>n; rep(i,n)cin>>k[i]>>l[i]>>d[i]; } int main(void){ init(); rep(i,n){ ll ue = l[i]>>d[i]; ans = ans ^ ((f(ue + k[i]-1) ^ f(ue-1))<>2; // ll c=b<<2; // cout<