#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

// 1-indexed
const int N = 1000010;
vector<ll> bit(N);
// a[p] ^= x
void add(int p, int x) {
  for (int i = p; i <= N; i += i & -i) {
    bit[i] ^= x;
  }
}
// a[1] ^ a[2] ^ ... ^ a[p]
ll sum(int p) {
  ll res = 0;
  for (int i = p; i > 0; i -= i & -i) {
    res ^= bit[i];
  }
  return res;
}

int main() {
  int n, q;
  cin >> n >> q;
  vector<ll> a(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    add(i, a[i]);
  }
  while (q--) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      add(x, y);
    }
    if (t == 2) {
      cout << (sum(y) ^ sum(x - 1)) << endl;
    }
  }
  return 0;
}
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#define int long long
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

const int DEPTH = 19;
class SegTree {
public:
	int val[1 << (DEPTH + 1)];
	SegTree() {
		for (int i = 0; i < (1 << (DEPTH + 1)); i++) {
			val[i] = 0;
		}
	}
	void update(int pos, int x) {
		pos += (1 << DEPTH) - 1;
		val[pos] ^= x;
		while (pos > 0) {
			pos = (pos - 1) / 2;
			val[pos] = val[2 * pos + 1] ^ val[2 * pos + 2];
		}
	}
	int query(int l, int r, int a = 0, int b = (1 << DEPTH), int id = 0) {
		if (a >= r || b <= l) return 0;
		if (l <= a && b <= r) return val[id];
		int res1 = query(l, r, a, (a + b) / 2, id * 2 + 1);
		int res2 = query(l, r, (a + b) / 2, b, id * 2 + 2);
		return res1 ^ res2;
	}
};

SegTree seg;
int n, q;
int a[300000];
int t, x, y;

signed main() {
	int i;
	
	cin >> n >> q;
	rep(i, n) cin >> a[i];
	rep(i, n) seg.update(i, a[i]);
	rep(i, q) {
		cin >> t >> x >> y;
		x--;
		if (t == 1) { seg.update(x, y); }
		else { cout << seg.query(x, y) << endl; }
	}
	return 0;
}