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

const int N = 3e5 + 5;

int tree[4 * N], n, a[N];

void built(int l = 1, int r = n, int pos = 1) {
	if (l == r) {
		tree[pos] = a[l];
		return;
	}

	int m = (l + r) / 2;

	built(l, m, 2 * pos);
	built(m + 1, r, 2 * pos + 1);

	tree[pos] = tree[2 * pos] ^ tree[2 * pos + 1];

}

void udt(int id, int val, int l = 1, int r = n, int pos = 1) {
	if (l == r) {
		tree[pos] ^= val;
		return;
	}

	int m = (l + r) / 2;
	if (id <= m) udt(id, val, l, m, 2 * pos);
	else udt(id, val, m + 1, r, 2 * pos + 1);

	tree[pos] = tree[2 * pos] ^ tree[2 * pos + 1];

}

int get(int tl, int tr, int l = 1, int r = n, int pos = 1) {
	if (tl > r || l > tr) return 0;
	if (tl <= l && r <= tr) return tree[pos];

	int m = l + r >> 1;
	int k1 = get(tl, tr, l, m, 2 * pos);
	int k2 = get(tl, tr, m + 1, r, 2 * pos + 1);
	return k1 ^ k2;
}

void solve(){
	int q;		
	cin >> n >> q;

	for (int i = 1; i <= n; i++) 
		cin >> a[i];

	built();

	while (q--) {
		int type, x, y;
		cin >> type >> x >> y;
		if (type & 1) udt(x, y);
		else cout << get(x, y) << '\n';
	}

}

signed main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	solve();

}
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define pi 2*acos(0.0)

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define FORE(x, a) for (auto& x: a)

#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }


template <class T> struct Tree {
	static const T LOW = INT_MIN;
	T f(T a, T b) { return a^b; } // any associative func
	vector<T> s; int n; // main segtree vector, size of init vector
	Tree(int n = 0) : s(2*n, 0), n(n) {} 
	void update(int pos, T val) { // s[pos] = val
		for (s[pos += n] = val; pos > 1; pos /= 2)
			s[pos / 2] = f(s[pos & ~1], s[pos | 1]);
	}
	T query(int b, int e) { // query [b, e)
		T ra = LOW, rb = LOW;
		for (b += n, e += n; b < e; b /= 2, e /= 2) {
			if (b&1) ra = f(ra, s[b++]);
			if (e&1) rb = f(s[--e], rb);
		}
		return f(ra, rb);
	}
};
// kactl

void solve(){
    int n,q; cin >> n >> q;
    vector<int> a(n);
    FOR(n) cin >> a[i];
    Tree<int> st(n);
    FOR(n) st.update(i,a[i]);
    FOR(q){
        int t,x,y; cin >> t >> x >> y;
        --x; --y;
        if(t == 1){
            a[x] ^= (y+1);
            st.update(x,a[x]);
        } else{
            cout << st.query(x,y+1) << '\n';
        }
    }
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	solve();
	return 0;
}
 
