#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pi pair<ll,ll>
#define pii pair<ll,pi>
#define pb push_back
#define mk make_pair
const ll siz = 3e5 + 7;
ll t[4 * siz];
int n, q;
void built(int a[], int tl , int tr, int v) {
	if (tl == tr) {
		t[v] = a[tl];
	}
	else
	{
		int tm = (tl + tr) / 2;
		built(a, tl, tm, 2 * v);
		built(a, tm + 1, tr, 2 * v + 1);
		t[v] = (t[2 * v] ^ t[2 * v + 1]);
	}
}

void update(int v, int tl, int tr, int pos, int val) {
	if (tl == tr) {
		t[v] = val;
	}
	else
	{
		int tm = (tl + tr) / 2;
		if (pos <= tm)
			update(2 * v, tl, tm, pos, val);
		else
			update(2 * v + 1, tm + 1, tr, pos, val);
		t[v] = (t[2 * v] ^ t[2 * v + 1]);
	}
}

ll query(int v, int tl, int tr , int l , int r) {
	if (l > r)return 0;
	if (l == tl && r == tr) {
		return t[v];
	}
	int tm = (tr + tl) / 2;
	return (query(2 * v, tl, tm, l, min(r, tm)) ^query(2 * v + 1, tm + 1, tr, max(l, tm + 1), r));
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> q;
	int a[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	built(a, 0, n - 1, 1);
	while (q--) {
		int t;
		cin >> t;
		if (t == 2) {
			int u, v;
			cin >> u >> v;
			--u;
			--v;
			cout << query(1, 0, n - 1, u, v) << endl;
		}
		else
		{
			int u, v;
			cin >> u >> v;
			--u;
			int by = v ^ a[u];
			update(1, 0, n - 1, u, by);
			a[u] = by;
		}
	}
}
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;


template< typename T >
struct BinaryIndexedTree {
  vector< T > data;

  BinaryIndexedTree(int sz) {
    data.assign(++sz, 0);
  }

  T sum(int k) {
    T ret = 0;
    for(++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }

  void add(int k, T x) {
    for(++k; k < data.size(); k += k & -k) data[k] += x;
  }
};

int main() {
#ifdef DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll N, Q;
    cin >> N >> Q;
    static ll A[300300];
    static ll T[300300];
    static ll X[300300];
    static ll Y[300300];
    BinaryIndexedTree<ll>* Count[31];
    
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    for(int i = 0; i < Q; i++){
        cin >> T[i] >> X[i] >> Y[i];
    }
    for(int j = 0; j < 31; j++){
        Count[j] = new BinaryIndexedTree<ll>(N*2);
    }
    
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 31; j++){
            if( (A[i] >> j) & 1){
                Count[j]->add(i, 1);
            }
        }
    }
    
    for(int i = 0; i < Q; i++){
        if(T[i] == 1){
            ll newA = A[X[i]] ^ Y[i];
            for(int j = 0; j < 31; j++){
                if( (A[X[i]] >> j) & 1){
                    Count[j]->add(X[i]-1, 1);
                }
                if( (newA >> j) & 1){
                    Count[j]->add(X[i]-1, 1);
                }
            }
            A[X[i]] = newA;
        }else{
            ll output = 0;
            ll two = 1;
            for(int j = 0; j < 31; j++){
                if(X[i] > 1){
                if( (Count[j]->sum(Y[i]-1) - Count[j]->sum(X[i]-2)) % 2 == 1){
                    output += two;
                }
                }else{
                    if( (Count[j]->sum(Y[i]-1)) % 2 == 1){
                        output += two;
                    }
                }
                two *= 2;
            }
            cout << output << endl;
        }
    }
    return 0;
}
