#include<bits/stdc++.h>
#define faster  ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define pb push_back
const double PI = acos(-1.0);
using namespace std;



ll a[300009];
ll tree[900099];
int c;

void seg(ll node,ll b,ll e)
{
    if(b==e)
    {

        //cout<<node<<" "<<a[b]<<endl;
        tree[node]=a[b];

        //cout<<tree[node].value<<endl;
        return;
    }

    ll left=node*2;
    ll right=(node*2)+1;

    ll mid=(b+e)/2;

    seg(left,b,mid);
    seg(right,mid+1,e);

    tree[node]=tree[left]^tree[right];


}

ll query(int node,int b,int e,int i,int j)
{
    if(i>e || j<b)
        return 0;

    if(i<=b && e<=j)
        return tree[node];

    ll left=node*2;
    ll right=(node*2)+1;

    ll mid=(b+e)/2;

    ll x=query(left,b,mid,i,j);
    ll y=query(right,mid+1,e,i,j);

    return x^y;
}



void update(ll node,ll b,ll e,ll i,ll value)
{
    if(i>e || i<b)
        return;

    if(i<=b && e<=i)
    {
        tree[node]^=value;

        return;
    }

    ll left=node*2;
    ll right=(node*2)+1;

    ll mid=(b+e)/2;

    update(left,b,mid,i,value);
    update(right,mid+1,e,i,value);


    tree[node]=tree[left]^tree[right];

}



int main()
{
    faster

    int n,q;
    cin>>n>>q;



    for(int i=1; i<=n; i++)
        cin>>a[i];

    seg(1,1,n);


    /*for(int i=1; i<=3*n; i++)
        cout<<tree[i].value<<" ";
    cout<<endl;*/






    ll t,l,r;
    while(q--)
    {
        cin>>t>>l>>r;

        if(t==1)
        {
            update(1,1,n,l,r);

        }
        else
        {
            cout<<query(1,1,n,l,r)<<endl;
        }
    }








    return 0;
}





#include<ctime>
#include<cstdio>
#include<cctype>
#define le(p) ((p)<<1)
#define ri(p) ((p)<<1|1)
using namespace std;
const int N=1.2e6+7;
int read(){
	char c;
	int x=0,f=1;
	while(!isdigit(c=getchar()))
		f-=2*(c=='-');
	while(isdigit(c)){
		x=x*10+f*(c-48);
		c=getchar();
	}
	return x;
}
int n,q,t,x,y,a[N];
int L[N],R[N],X[N];
void up(int p){
	X[p]=X[le(p)]^X[ri(p)];
}
void build(int p,int l,int r){
	L[p]=l;
	R[p]=r;
	if(l==r){
		X[p]=a[l];
		return;
	}
	int m=(l+r)>>1;
	build(le(p),l,m);
	build(ri(p),m+1,r);
	up(p);
}
void upd(int p,int x,int k){
	if(L[p]==R[p]){
		X[p]^=k;
		return;
	}
	int m=(L[p]+R[p])>>1;
	if(x<=m)
		upd(le(p),x,k);
	else
		upd(ri(p),x,k);
	up(p);
}
int ask(int p,int l,int r){
	if(l<=L[p]&&R[p]<=r)
		return X[p];
	int m=(L[p]+R[p])>>1;
	int res=0;
	if(l<=m)
		res^=ask(le(p),l,r);
	if(r>m)
		res^=ask(ri(p),l,r);
	return res;
}
int main(){
	#ifndef ONLINE_JUDGE
	freopen("F.in","r",stdin);
	freopen("F.out","w",stdout);
	#endif
	clock_t t1=clock();
	//--------
	n=read();
	q=read();
	for(int i=1;i<=n;++i)
		a[i]=read();
	build(1,1,n);
	for(int i=1;i<=q;++i){
		t=read();
		x=read();
		y=read();
		if(t==1)
			upd(1,x,y);
		else
			printf("%d\n",ask(1,x,y));
	}
	//--------
	fprintf(stderr,"%0.3lfs",1.0*(clock()-t1)/CLOCKS_PER_SEC);
	return 0;
}