#include <bits/stdc++.h>
#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
using namespace std;
const int INF = (int) 1e9;
const int mod = (int) 1e9+7;
const int MAXN = (int) 3e5+5;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
vector<int> bit[30];
int n,q;
int arr[MAXN];
void upd(int pos,int val,int b){
    for(;pos<n;pos+=pos&-pos){
        bit[b][pos]+=val;
    }
}
int sum(int pos,int b){
    int ret = 0;
    for(;pos>0;pos-=pos&-pos){
        ret += bit[b][pos];
    }
    return ret;
}
void solve(){
    cin >> n >> q;
    n++;
    for(int i=0;i<30;i++){
        bit[i].assign(n,0);
    }
    for(int i=1;i<n;i++){
        cin >> arr[i];
        for(int b=0;b<30;b++){
            if((1<<b)&arr[i]){
                //cout << arr[i] << " "<< b << " ";
                upd(i,1,b);
            }
        }
        //cout << endl;
    }
    while(q--){
        int t,x,y;
        cin >> t >> x >> y;
        if(t == 1){
            int val = arr[x] ^y;
            for(int i=0;i<30;i++){
                if((1<<i) & val && !((1<<i) & arr[x])){
                    upd(x,-1,i);
                }
                if(!((1<<i) & val) && (1<<i) & arr[x]){
                    upd(x,1,i);
                }
            }
            arr[x] = val;
        }
        if(t == 2){
            int ans = 0;
            for(int i=0;i<30;i++){
                if((sum(y,i)-sum(x-1,i))%2){
                    ans+=(1<<i);
                }
            }
            cout << ans << endl;
        }
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);cout.tie(nullptr);
    #ifdef Local
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    #ifdef Local
    cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds ";
    #endif
}
#include<bits/stdc++.h>
using namespace std;
typedef  long long  ll;
ll inf=1000000000000000000,mod=1000000007;
ll bit[300005];
ll update(ll idx,ll val,ll n=300005){
    idx++;
    while(idx<n){
        bit[idx]^=val;
        idx+=idx&-idx;
    }
    return 0;
}
ll getsum(ll idx){
    ll sum=0;
    if(idx<=0)
    return 0;
    while(idx>0){
        sum^=bit[idx];
        idx-=idx&-idx;
    }
    return sum;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    ll n,q;cin>>n>>q;
    ll arr[n];
    for(ll i=0;i<n;i++)cin>>arr[i];
    for(ll i=1;i<n;i++)arr[i]^=arr[i-1];
    ll a,b,rig,lef;
    while(q--){
        cin>>a;
        if(a==1){
            cin>>a>>b;
            update(a-1,b);
        }
        else
        {
            cin>>a>>b;
            rig=arr[b-1]^getsum(b);
            if(a-2>=0)
            lef=arr[a-2]^getsum(a-1);
            else
            lef=0;
            cout<<(rig^lef)<<endl;
        }

    }


}
