#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) v.begin(), v.end()
template<class T>bool chmax(T& a, const T& b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T& a, const T& b) { if (b<a) { a=b; return 1;} return 0;}

int main() {
    ll N, Q; cin >> N >> Q;
    vector<ll> A(N); rep(i, N) cin >> A[i];
    vector<ll> sen(100000, 0);
    for (int i = 0; i < N; ++i) {
        sen[i/1000] ^= A[i];
    }

    for (int q = 0; q < Q; ++q) {
        ll t, x, y;
        cin >> t >> x >> y;
        --x; --y;
        if (t == 1) {
            A[x] ^= (y+1);
            sen[x/1000] ^= (y+1);
        }
        else if (t == 2 && y - x > 2100) {
            ll res = 0;

            ll num = x;
            while (num%1000 != 0) {
                res ^= A[num];
                ++num;
            }

            for (int i = (x+999)/1000; i < y/1000; ++i) {
                res ^= sen[i];
            }

            ll tmp = (y/1000) * 1000;
            while (tmp != y+1) {
                res ^= A[tmp];
                ++tmp;
            }

            cout << res << endl;
        }
        else {
            ll res = 0;
            for (int i = x; i <= y; ++i) {
                res ^= A[i];
            }
            cout << res << endl;
        }
    }
}

// Problem: F - Range Xor Query
// Contest: AtCoder - AtCoder Beginner Contest 185
// URL: https://atcoder.jp/contests/abc185/tasks/abc185_f
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
#define int         long long int
#define vi           vector<int>
#define pii          pair<int,int>
#define vpp          vector<pii>
#define mii          map<int,int>
#define pb           push_back
#define rep(i,a,bb)  for(int i=a;i<bb;i++)
#define ff           first
#define ss           second
#define fast         ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test         int T;cin>>T;while(T--)
#define __sort(v)    sort(v.begin(),v.end())
#define __rsort(v)   sort(v.rbegin(),v.rend())
#define setbits(x)   __builtin_popcount(x)
#define zrobits(x)   __builtin_ctzint(x)
#define endl '\n'
#define debug(x)  cerr<<"[ "<<#x<<" : "<<x<<" ]"<<endl
#define debugp(x) cerr<<"[ "<<#x<<".ff : "<<x.first<<", "<<#x<<".ss : "<<x.second<<" ]"<<endl
#define debugs(x) cerr<<"[ "; for(auto i:x) cerr<<i<<" "; cerr<<" ]"<<endl;
#define debugm(x) cerr<<"----------"<<endl; for(auto i:x) cerr<<i.ff<<":"<<i.ss<<endl; cerr<<"----------"; 
#define PI 3.14159265359
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};
int dxk[]={0,0,1,-1,1,1,-1,-1};
int dyk[]={1,-1,0,0,1,-1,1,-1};
const int inf = 1e+18;
const int mod = 1e+9 + 7;
int cases = 1;
 
int power(int x, int p, int m){
	int res = 1;
	while(p){
		if(p&1)
		  res=(res*x)%m;
		x = (x*x)%m;
		p/=2;
	}
	return res;
}
 
int inverse_mod(int x, int p, int m){
	// Fermat's little theorem 
	// a^p = a  % p
	// a^(p-1) = a % p 
	// a^(p-2) = (1/a)%p => inverse modulo 
	return power(x, p-2, m);
}
 



const int mxN = 1200005;
int tree[mxN];

void update(int v){
	tree[v] = tree[2*v] ^ tree[2*v+1];
}

int combine(int l, int r){
    
    return l^r;
}

void build(int v, int tl, int tr, int* a){
	if(tl>tr)
	   return;
	if(tl==tr){
		tree[v] = a[tl];
		return;
	}
	int mid = (tl+tr)/2;
	build(2*v, tl, mid, a);
	build(2*v+1, mid+1, tr, a);
	update(v);
	
}

void modify(int v, int tl, int tr, int pos, int val){
	if(tl>tr)
	   return;
	if(tl==tr){
		tree[v] = tree[v] ^ val;
		return;
	}
	int mid = (tl+tr)/2;
	if(pos<=mid)
	   modify(2*v, tl, mid, pos, val);
	else 
	   modify(2*v+1, mid+1, tr, pos, val);
	update(v);
	
}
int mrs(int v, int tl, int tr, int ql, int qr){
	if(tl>qr||tr<ql)
	{
		return 0;
	}
	if(tl>=ql&&tr<=qr){
		return tree[v];
	}
	int mid = (tl+tr)/2;
     return mrs(2*v, tl, mid, ql, qr)^mrs(2*v+1, mid+1, tr, ql, qr);
}
 
 
void solve()
{
	int n, q;
	cin>>n>>q;
	
	int a[n];
	
	rep(i,0,n)
	  cin>>a[i];
	  
	build(1, 0, n-1, a);
	
	rep(i,0,q)
	{
		int x, y, z;
		cin>>x>>y>>z;
		
		if(x==1)
		{
			modify(1, 0, n-1, y-1, z);
		}
		else
		{
			cout<<mrs(1,0,n-1,y-1,z-1)<<endl;
		}
	}
	  
	
}
 
int32_t main()
{
  fast;
  //test{
 // cout<<"Case #"<<cases<<": ";
  solve();
  //++cases;
  //}
  return 0;
}