#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

ll getXOR(ll BITree[], ll index) {
  ll ans = 0;
  index += 1;
  while (index > 0) {
    ans ^= BITree[index];
    index -= index & (-index);
  }
  return ans;
}

void updateBIT(ll BITree[], ll n, ll index, ll val) {
  index = index + 1;
  while (index <= n) {
    BITree[index] ^= val;
    index += index & (-index);
  }
}

ll* constructBITree(ll arr[], ll n) {
  ll* BITree = new ll[n + 1];
  for (ll i = 1; i <= n; i++) BITree[i] = 0;
  for (ll i = 0; i < n; i++) updateBIT(BITree, n, i, arr[i]);

  return BITree;
}

ll rangeXor(ll BITree[], ll l, ll r) {
  return getXOR(BITree, r) ^ getXOR(BITree, l - 1);
}

int main() {
  int n, q;
  cin >> n >> q;
  ll a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  ll* BITree = constructBITree(a, n);
  while (q--) {
    ll t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      x--;
      a[x] ^= y;
      updateBIT(BITree, n, x, y);
    } else {
      x--, y--;
      cout << rangeXor(BITree, x, y) << "\n";
    }
  }
  return 0;
}
#include <bits/stdc++.h>
 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef long int li;
 
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define test ll t; cin >> t; while(t--)
const long long int cons = 300005;
const long long int N = 100005;
const long long int MOD = 1000000007;
// const long long int MOD = 998244353; 
const long long int const_INT_MAX = 1000000000000000000;
const long long int const_INT_MIN = -1 * 1000000000000000000;
 
using namespace std;
// to sort pair vector in reverse order 
bool sortinrev(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.first > b.first); 
}
// to sort pair vector according to the second elements 
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.second < b.second); 
}
// to sort pair vector according to the second elements in reverse order
bool sortbysecinrev(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.second > b.second); 
}
ll lcm(ll x, ll y){
    return (ll)((x * y) / __gcd(x, y)); 
}
map<ll, ll> primeFact(ll n){
    map<ll, ll> mp;
    while(n % 2 == 0){
       mp[2]++; 
       n = n / 2; 
    }
    for(ll i=3;i<=sqrt(n);i+=2){
        while(n % i == 0){
            mp[i]++;
            n = n / i; 
        }
    }
    if(n > 2){
        mp[n]++; 
    }
    return mp; 
}
ll mod_expo(ll x, ll y, ll p){  
    // reference from GFG
    ll res = 1;
    if((x + p) % p == 0){
        res = 0;
    }
    else {
        x = (x + p) % p;
        while (y > 0){   
            if (y & 1){ 
                res = (res*x + p) % p; 
            }
            y = y>>1;
            x = (x*x + p) % p;  
        }  
    }
    return res;     
}
struct Segtree { 
    ll siz; 
    vector<ll> ar;
    ll oper(ll a, ll b){
        return (ll)(a ^ b);
    } 
    void init(ll n){
        siz = 1; 
        while(siz < n){
            siz = siz * 2; 
        }
        ar.assign(2 * siz, (ll)(0));
    }
    ll query(ll v, ll l, ll r, ll l_bound, ll r_bound){
        if(l >= r_bound || r <= l_bound){return 0;}
        if(l >= l_bound && r <= r_bound){return ar[v];}

        ll mid = l + (r - l) / 2;
        return oper(query(v*2+1, l, mid, l_bound, r_bound), query(v*2+2, mid, r, l_bound, r_bound));
    }
    void update(ll v, ll l, ll r, ll pos, ll val){
        if(!(r - (l + 1))){
            ar[v] = val;
        }
        else {
            ll mid = l + (r - l) / 2;
            if(pos < mid){
                update(v*2+1, l, mid, pos, val);
            }
            else {
                update(v*2+2, mid, r, pos, val);
            }
            ar[v] = oper(ar[v*2+1], ar[v*2+2]);
        }
    }
};
int main(){
    #ifdef n00bie_1004_local 
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    fastio  
    /* ll p = MOD;
    InverseofNumber(p); 
    InverseofFactorial(p); 
    factorial(p); */
    ll n, q; cin >> n >> q; ll a[n]; 
    Segtree seg; seg.init(n); 
    for(ll i=0;i<n;i++){
        cin >> a[i];  
        seg.update(0, 0, n, i, a[i]); 
    } 
    for(ll i=0;i<q;i++){
        ll typ; cin >> typ; 
        if(!(typ - 1)){
            ll x, y; cin >> x >> y; x--; 
            a[x] ^= y;
            seg.update(0, 0, n, x, a[x]);
        }
        else if(!(typ - 2)){
            ll l, r; cin >> l >> r; l--;  
            ll ans = seg.query(0, 0, n, l, r);
            cout << ans << "\n";
        }
    } 
}  