#pragma GCC optimize("Ofast")   //Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  endl           "\n"
#define  pb             push_back
#define  sym(s)         s="#"+s+"#";
#define  mp             make_pair
#define  s              second
#define  f              first
#define  dline          cerr<<"///REACHED///\n";
#define  debv(a)        for(auto it: a)cout<<it<<" ";cout<<endl;
#define  deb1(a)        cout<<a<<endl;
#define  deb2(a,b)      cout<<a<<" "<<b<<endl;
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<endl;
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());

typedef  long long             ll;
typedef  unsigned long long    ull;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   N  =  3e+5+7;

vll adj[N];ll vis[N]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

//<<-----Declare Variable Here------->>//
int t=1;
ll n,a[N],q;
//<<-----Implement Functions Here---->>//
//input-array from which segtree(tree) is formed
//here example shown is min range query change as needed
//make 1 indexe input,so use build(1,1,n) etc
ll tree[4*N+8];

ll merge(ll a,ll b){
	return a^b;
}

void build(ll node, ll start, ll end){
	if(start == end){
		tree[node] = a[start];
	}
	else
	{
		ll mid = (start + end) / 2;
		build(2*node, start, mid);
		build(2*node+1, mid+1, end);
		tree[node] = merge(tree[2*node],tree[2*node+1]);
	}
}

void update(ll node, ll start, ll end, ll pos, ll val){
	if(start == end){
		tree[node] = tree[node]^val;
	}
	else
	{
		ll mid = (start + end) / 2;
		if(pos <= mid)
			update(2*node, start, mid, pos, val);
		else
			update(2*node+1, mid+1, end, pos, val);
		tree[node] = merge(tree[2*node],tree[2*node+1]);
	}
}

ll query(ll node, ll start, ll end, ll l, ll r){
	if(start > end or start > r or end < l)
		return 0;
	if(l <= start and end <= r)
		return tree[node];
	ll mid = (start + end)/2;
	ll p1 = query(2*node, start, mid, l, r);
	ll p2 = query(2*node+1, mid+1, end, l, r);
	return merge(p1,p2);
}

//<<-----Start of Main--------------->>//
void MAIN(){
		cin>>n>>q;
		for(ll i=1;i<=n;i++)cin>>a[i];
		build(1,1,n);
		while(q--){
			ll ch,x,y;
			cin>>ch>>x>>y;
			if(ch==1){
				update(1,1,n,x,y);
			}
			else cout<<query(1,1,n,x,y)<<endl;
		}
}

int main(){
    fastio;randomINIT;

    //cin>>t;
    while(t--){
        MAIN();
    }

    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <numeric>
#include <math.h>

using namespace std;

#define rep(i, n) for (long long int i = 0; i < (long long int)(n); i++)
#define irep(i, n) for (long long int i = 1; i <= (long long int)(n); i++)
#define drep(i, n, diff) for (long long int i = 0; i < (long long int)(n); i += diff)
#define mod 1000000007
#define cdeb(val) cout << #val << ":" << val << endl;
#define pdeb(val) printf("%s : %lld\n", #val, val);

typedef long long int ll;
typedef pair<ll, ll> P;

struct BIT {
  ll n;
  vector<ll> b;
  BIT(ll idx) : n(idx+1), b(n, 0) {}

  void init(vector<ll> a) {
    for(ll i = 0; i < a.size(); i++) {
      add(i+1, a[i]);
    }
  }

  // sum: b[1] ~ b[i];
  ll sum(ll i) {
    ll ret = 0;
    while(i > 0) {
      ret ^= b[i];
      i -= i & -i;
    }
    return ret;
  }

  // sum: b[x] ~ b[y];
  ll range_sum(ll x, ll y) {
    return sum(y) ^ sum(x-1);
  }

  void add(ll i, ll x) {
    while(i <= n) {
      b[i] ^= x;
      i += i & -i;
    }
  }
};

int main(){
  ll n, q;
  cin >> n >> q;

  vector<ll> a(n);
  rep(i, n) {
    cin >> a[i];
  }

  BIT b(n);
  b.init(a);

  vector<ll> ans;
  rep(i, q) {
    ll t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      b.add(x, y);
    } else {
      ans.push_back(b.range_sum(x, y));
    }
  }

  for(auto v: ans) {
    cout << v << endl;
  }

  return 0;
}
