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

const int MAX_NUM = 3e5 + 10;

int bit[MAX_NUM];

inline int low(int i) { return i & (-i); }

void update(int i, int k) {
    while (i < MAX_NUM) {
        bit[i] ^= k;
        i += low(i);
    }
}

int query(int i) {
    int res = 0;
    while (i > 0) {
        res ^= bit[i];
        i -= low(i);
    }
    return res;
}

int main() {
    int N, Q, num;
    cin >> N >> Q;
    for (int i = 0; i < N; i++) {
        cin >> num;
        update(i + 1, num);
    }
    int t, x, y;
    for (int i = 0; i < Q; i++) {
        cin >> t >> x >> y;
        if (t == 1) {
            update(x, y);
        }
        else {
            cout << (query(y) ^ query(x - 1)) << "\n";
        }
    }
    return 0;
}

//ye moh moh ke dhaage,tere ungliyon se ja uljhe
 
#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> 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 long 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; }
 
ll a[3*100002];
ll tree1[12*100002];//0 based indexing  (max)
 
void recalculate1(ll node){
    tree1[node]=(tree1[2*node+1]^tree1[2*node+2]);
}

void build1(ll node,ll l,ll r){
    if(l==r){ 
        tree1[node]=a[l];
        return;
    }
    ll m=(l+r)/2;
    build1(2*node+1,l,m);
    build1(2*node+2,m+1,r);
    recalculate1(node);
}


ll query1(ll node,ll l,ll r,ll ql,ll qr){
    if((ql>r)||(qr<l)) return(-1);
    if((ql<=l)&&(qr>=r)) return(tree1[node]);
    ll m=(l+r)/2;
    ll q1=query1(2*node+1,l,m,ql,qr);
    ll q2=query1(2*node+2,m+1,r,ql,qr);
    if(q1==-1) return(q2);
    if(q2==-1) return(q1);
    return(q1^q2); 
}

void update1(ll node,ll l,ll r,ll pos,ll val){
      if(l==r){
            a[l]=(a[l]^val);
            tree1[node]=a[l];
            return;
      }
      ll m=(l+r)/2;
      if(pos>m) (update1(2*node+2,m+1,r,pos,val));
      else (update1(2*node+1,l,m,pos,val));
      recalculate1(node);
      return;
}


int main(){
      ll n,q;
      cin>>n>>q;
      forn(i,n) cin>>a[i];
      build1(0,0,n-1);
      forn(i,q){
            ll t,x,y;
            cin>>t>>x>>y;
            if(t==1){
                  update1(0,0,n-1,x-1,y);
            }
            else{
                  //cout<<"---";
                  cout<<query1(0,0,n-1,x-1,y-1)<<endl;
            }
      }
      //cout<<a[9]<<" ";
}