#include <bits/stdc++.h>
//#include "atcoder/all"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
//using namespace atcoder;
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> P;
constexpr ll inf=1ll<<61;
constexpr ll mod=998244353;
int a[1050000];
int n=1;
int calc(int A,int B,int k,int l,int r){
	if(r<=A||B<=l)return 0;
	if(A<=l&&r<=B)return a[k];
	int vl=calc(A,B,k*2+1,l,(l+r)/2),vr=calc(A,B,k*2+2,(l+r)/2,r);
	return vl^vr;
}
int get(int l,int r){
	return calc(l,r,0,0,n);
}
int main(){
	int N,q;cin>>N>>q;
	while(n<N)n*=2;
	rep(i,N)cin>>a[n-1+i];
	for(int i=n-2;i>=0;i--)a[i]=a[2*i+1]^a[2*i+2];

	rep(i,q){
		int t;cin>>t;
		int x,y;cin>>x>>y;
		x--;
		if(t==1){
			x+=n-1;
			a[x]^=y;
			while(x){
				x=(x-1)/2;
				a[x]=a[x*2+1]^a[x*2+2];
			}
		}
		else{
			cout<<get(x,y)<<endl;
		}
	}
}
//Code by Mukul Totla
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
void sublime(){ 
    #ifndef ONLINE_JUDGE 
    freopen ("input.txt", "r", stdin);
    freopen ("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
      }
  
int main()
{   
   sublime();
    ll n,i,j;
     ll q;
     cin>>n>>q;
     ll arr[n];
     for(i=0; i<n; i++)
      cin>>arr[i];
    ll rootn=sqrt(n);
    vector<ll>v;
    ll val=0;
    ll cnt=0;
    for(i=0; i<n; i++)
    {
      val^=arr[i];
      cnt++;
      if(cnt==rootn)
      {
        cnt=0;
        v.push_back(val);
        val=0;
      }
    }
    if(cnt!=0)
      v.push_back(val);
    while(q--)
    {
      ll t,x,y;
      cin>>t>>x>>y;
      x--,y--;
      if(t==1)
      {
        y++;
        ll block=x/rootn;
        v[block]^=y;
        arr[x]^=y;
      }
      else
      {
        ll b1=x/rootn, b2=y/rootn;
        ll ans=0;
        if((b2-b1)>2)
        {
           for(i=b1+1; i<=b2-1; i++)
            ans^=v[i];
         // cout<<ans<<endl;
           for(i=x; i<(b1+1)*rootn; i++)
            ans^=arr[i];

          for(i=b2*rootn; i<=y; i++)
            ans^=arr[i];
          cout<<ans<<endl;
        }
        else
        {
          for(i=x; i<=y; i++)
            ans^=arr[i];
          cout<<ans<<endl;
        }
      }
    }
  return 0;
}