/*----- || Hare Krishna || -----*/
/*  "WHY DO WE FALL, BRUCE?"  */

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")

#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define precision(n) fixed<< showpoint << setprecision(n)
#define elif else if
#define pb push_back
#define pf push_front
#define PI 3.1415926535897932384
#define MOD 1000000007
using namespace std;

int lg2(const int &x){return 31 - __builtin_clz(x);}
long long int lg2(const long long int &x){return 63 - __builtin_clzll(x);}

char alpha[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

const int N = 300001;
int st[4*N];
int v[N];

void build(int si, int ss, int se){
	if(ss==se){
		st[si]=v[ss];
		return;
	}
	int mid = (ss+se)>>1;
	build(si<<1, ss, mid);
	build(si<<1|1, mid+1, se);
	st[si]=st[si<<1]^st[si<<1|1];
}

void upd(int si, int ss, int se, int val, int idx){
	if(ss==se){
		st[si]^=val;
		return;
	}
	int mid = (ss+se)>>1;
	if(idx<=mid){
		upd(si<<1, ss, mid, val, idx);
	}
	else{
		upd(si<<1|1, mid+1,se, val, idx);
	}
	st[si] = st[si<<1]^st[si<<1|1];
}

int query(int si, int ss, int se, int qs, int qe){
	
	if(qs>se || qe<ss){
		return 0;
	}
	
	if(qs<=ss && qe>=se){
		return st[si];
	}
	
	int mid = (ss+se)>>1;
	
	return query(si<<1, ss, mid, qs, qe)^query(si<<1|1, mid+1, se, qs, qe);
	
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
        
    int n,q;
	cin >> n >> q;
	for(int i=1; i<=n; i++){
		cin >> v[i];
	}   
	build(1,1,n);
	while(q--){
		int t,x,y;
		cin >> t >> x >> y;
		if(t==2){
			cout << query(1,1,n,x,y) << endl;
		}
		else{
			upd(1,1,n,y,x);
		}
	}
        
}

#include<bits/stdc++.h>
using namespace std;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int 	LL;
typedef vector<LL> 		VL;
#define si(n) cin>>n
#define dout(n) cout<<n<<"\n"
#define DRT() int t; si(t); while(t--)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//# define M_PI           3.14159265358979323846264338327950288
// DSU

void IO(){
	#ifndef ONLINE_JUDGE
    freopen("../input.txt", "r", stdin);
    freopen("../output.txt", "w", stdout);
	#endif
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	off;
}
LL n,q;
VL segtree;
VL arr;
void build(int l, int r, int node){
	if(l == r){
		segtree[node] = arr[l];
		return ;
	}
	LL mid = l + (r - l)/2;
	build(l, mid, 2*node);
	build(mid+1, r, 2*node+1);
	segtree[node] = segtree[2*node] ^ segtree[2*node+1];
}
void update(int l, int r, int node, int ind, int val){
	if(l == r){
		segtree[node] = val;
		return ;
	}
	LL mid = l + (r - l)/2;
	if(ind <= mid)
		update(l, mid, 2*node, ind, val);
	else
		update(mid+1, r, 2*node+1, ind, val);
	segtree[node] = segtree[2*node] ^ segtree[2*node+1];
}
LL query(int l, int r, int gl, int gr, int node){
	if(l > r || l > gr || r < gl)
		return 0;
	if(l >= gl && r <= gr)
		return segtree[node];
	LL mid = l + (r - l)/2;
	return query(l, mid, gl, gr, 2*node)^query(mid+1, r, gl, gr, 2*node+1);
}
int main(){
	IO();
	cin>>n>>q;
	segtree.resize(4*n + 2);
	arr.resize(n);
	rep(i,0,n){
		cin>>arr[i];
	}
	build(0, n-1, 1);
	rep(i,0,q){
		LL t,x,y;
		cin>>t>>x>>y;
		x--;
		if(t == 1){
			update(0, n-1, 1, x, arr[x]);
			arr[x] = arr[x] ^ y;
			update(0, n-1, 1, x, arr[x]);
		}
		else{
			y--;
			dout(query(0, n-1, x, y, 1));
		}
	}
	return 0;
}