#include<bits/stdc++.h>
#define rep(i,n) for(int i =0;i<n;++i)
#define reps(i,s,n) for(int i =s;i<n;++i)
using namespace std;
using P = pair<int, int>;
using ll = long long;

//0-indexed
template<class T, T (*op)(T,T), T(*e)()>
class segtree
{
private:
    int n;
    vector<T> v;
public:
    segtree(int n_)
    {
        int x = 1;
        while (n_ > x) x <<= 1;
        n = x;
        v.resize(2 * n - 1, e());
    }

    void set(int k, T x)
    {
        k += n - 1;
        v[k] = x;
        while (k > 0)
        {
            k = (k - 1) / 2;
            v[k] = op(v[k*2+1],v[k*2+2]);
        }
    }
    T get(int k) { return v[k + n - 1]; }

    //[a,b)
    T query(int a, int b) { return query_sub(a, b, 0, 0, n); }
    T query_sub(int a, int b, int k, int l, int r) {
        if (b <= l || r <= a) return e();
        if (a <= l && r <= b) return v[k];
        T c1 = query_sub(a, b, 2 * k + 1, l, (l + r) / 2);
        T c2 = query_sub(a, b, 2 * k + 2, (l + r) / 2, r);
        return op(c1,c2);
    }

    //display segtree value
    void display(string text = "segtree value")
    {
        cout << text << endl;
        int cnt = 0;
        int end = 1 << cnt;
        int l = v.size();
        for (int i = 0; i < l; ++i)
        {
            cout << v[i] << " ";
            if (i == end - 1) 
            {
                ++cnt;
                end += 1<<cnt;
                cout << endl;
            }
        }
        cout << endl;
    }
};

int op(int a, int b) { return a ^ b; }
int e() { return 0; }

int main()
{
	int n,q;
    cin >> n >> q;
    segtree<int,op,e> sg(n);
    rep(i, n)
    {
        int ai; cin >> ai;
        sg.set(i,ai);
    }
    rep(i, q)
    {
        int t, x, y;
        cin >> t >> x >> y;
        --x;
        if (t == 1) sg.set(x, op(sg.get(x), y));
        else printf("%d\n", sg.query(x,y));
    }
	return 0;
}
#include<bits/stdc++.h>
#define ll long long int
#define deb1(x) cout<<#x<<" :: "<<x<<"\n";
#define deb2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define deb3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
ll mod=1e9+7;
using namespace std;
ll a[1000000],seg[2*1000000];
ll make(ll ind,ll low,ll high){
if(low==high){
seg[ind]=a[low];
return seg[ind];
}
ll mid=(low+high)/2;
ll left=make(2*ind+1,low,mid);
ll right=make(2*ind+2,mid+1,high);
seg[ind]=left^right;
//cout<<ind<<"--"<<seg[ind]<<endl;
return seg[ind];
}
ll query(ll ind,ll low,ll high,ll l, ll r){
if(l<=low && r>=high){

return seg[ind];
}
if(high<l || low>r)return 0;
ll mid=(low+high)/2;
ll left=query(2*ind+1,low,mid,l,r);
ll right=query(2*ind+2,mid+1,high,l,r);
return left^right;
}
ll update(ll ind,ll low,ll high,ll l, ll r){
//cout<<low<<" "<<high<<endl;
if(high<l || low>l){
return seg[ind];
}

if(low==l && high==l){
seg[ind]=seg[ind]^r;
return seg[ind];
}
ll mid=(low+high)/2;
ll left=update(2*ind+1,low,mid,l,r);
ll right=update(2*ind+2,mid+1,high,l,r);
seg[ind]=left^right;
return seg[ind];
}

int main(){
     ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     ll n,m,fl=0;
    cin>>n>>m;
    for(ll i=0;i<n;i++){
    cin>>a[i];
    }
    make(0,0,n-1);
    ll s,l,r,u;
    for(ll i=0;i<m;i++){
    cin>>u>>l>>r;
    if(u==1){
    update(0,0,n-1,l-1,r);
    }
    else{
    ll ans=query(0,0,n-1,l-1,r-1);
    cout<<ans<<endl;
    }
   
    }
   
   
   
    }
