#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

const int maxN = 3e5 + 5;
int a[maxN] = {0};
int n;

void update(int idx, int val) {
    while (idx <= n) {
        a[idx] ^= val;
        idx += (idx & -idx);
    }
}

int query(int idx) {
    int ans = 0;
    while (idx > 0) {
        ans ^= a[idx];
        idx -= (idx & -idx);
    }
    return ans;
}

int32_t main()
{
    init();

    int q;
    cin >> n >> q;

    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        update(i + 1, x);
    }    

    while (q--) {
        int t, x, y;
        cin >> t >> x >> y; 
        if (t == 1) {
            update(x, y);
        } else {
            cout << (query(y) ^ query(x - 1)) << "\n";
        }
    }

    return 0;
}
#include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, a, b) for (int i = (int)(a); i >= (int)b; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, r, l) for (int i = (r); i >= (l); i--)
#define ms(x, y) memset(x, y, sizeof(x))
#define SZ(x) int(x.size())
#define fk cerr<<"fk"<<endl
#define db(x) cerr<<(#x)<<'='<<(x)<<endl
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
//1.integer overflow (1e5 * 1e5) (2e9 + 2e9)
//2.runtime error
//3.boundary condition
const int N=300000+100;
int n,q,a[N],tv[N*4];
void build(int node,int l,int r){
	if(l==r){
		tv[node]=a[l];
		return;
	}
	int mid=(l+r)>>1;
	build(node<<1,l,mid);
	build(node<<1|1,mid+1,r);
	tv[node]=tv[node<<1]^tv[node<<1|1];
}
void update(int node,int l,int r,int idx,int val){
	if(l==r){
		int tt=val^a[l];
		tv[node]=tt;
		a[l]=tt;
		return;
	}
	int mid=(l+r)>>1;
	if(idx<=mid) update(node<<1,l,mid,idx,val);
	else update(node<<1|1,mid+1,r,idx,val);
	tv[node]=tv[node<<1]^tv[node<<1|1];
}
int query(int node,int l,int r,int ql,int qr){
	if(ql<=l && r<=qr){
		return tv[node];
	}
	int ret=0;
	int mid=(l+r)>>1;
	if(ql<=mid) ret^=query(node<<1,l,mid,ql,qr);
	if(qr>mid) ret^=query(node<<1|1,mid+1,r,ql,qr);
	return ret;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);                             
    cout.precision(10);
    cout<<fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "r", stdin);
#endif
    cin>>n>>q;
    for1(i, n){
    	cin>>a[i];
    }
    build(1,1,n);
    forn(i, q){
		int t,x,y;
		cin>>t>>x>>y;
		if(t==1) update(1,1,n,x,y);
		else cout<<query(1,1,n,x,y)<<'\n';
	}
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}