1 #include<iostream>
2 #include<cstdlib>
3 #include<cstdio>
4 #include<cstring>
5 #include<algorithm>
6 #include<map>
7 #include<queue>
8 #include<string>
9 #include<cmath>
10 using namespace std;
11 int n,la,zz;
12 int a[4000005];
13 int f[4000005];
14 int sum[4000005];
15 int nand(int x,int y){
16 return (!(x&y));
17 }
18 int na[50];
19 int su[4000005][2];
20 int main(){
21 // freopen("nand.in","r",stdin);
22 // freopen("nand.out","w",stdout);
23 scanf("%d",&n);
24 for(int i=1;i<=n;i++)
25 {
26 int z;
27 scanf("%d",&z);
28 if(z==1)
29 {
30 int x;
31 scanf("%d",&x);
32 x^=la;
33 zz++;
34 a[zz]=x;
35
36 f[zz]=nand(f[zz-1],a[zz]);
37 sum[zz]=sum[zz-1]^f[zz];
38
39 su[zz][0]=su[zz-1][0];
40 su[zz][1]=su[zz-1][1];
41
42 su[zz][x]++;
43 }
44 else
45 {
46 int x,y;
47 scanf("%d%d",&x,&y);
48 if(la)
49 {
50 x=zz-x+1;
51 y=zz-y+1;
52 swap(x,y);
53 }
54 int cnt=a[x],bj=0,sm=a[x];
55 for(int i=x+1;i<=y;i++)
56 {
57 sm=nand(sm,a[i]);
58 if(sm==f[i])
59 {
60 bj=i;
61 break;
62 }
63 cnt^=sm;
64 }
65 if(bj) cnt^=sum[y]^sum[bj-1];
66 la=cnt;
67 printf("%d\n",la);
68 }
69 }
70 // while(1);
71 return 0;
72 }