#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
const ll mod = 3e5+2;

int n;
ll t[4*mod];

void build(ll h[],int v,int tl,int tr){
    if(tl == tr) t[v] = h[tl];
    else{
        int tm = (tl+tr)/2;
        build(h,v<<1,tl,tm);
        build(h,(v<<1)+1,tm+1,tr);
        t[v] = (t[v<<1]^t[(v<<1) +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 = (tl+tr)/2;
    int left = v<<1;
    return (query(left,tl,tm,l,min(r,tm))^query(left+1,tm+1,tr,max(l,tm+1),r));
}

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

        t[v] = (t[left]^t[left+1]);
    }
}
main(){
    int n,q;
    cin>>n>>q;
    ll a[n];
    for(int i=0;i<n;i++) cin>>a[i];
    build(a,1,0,n-1);
    while(q--){
        int t;cin>>t;
        if(t==1) {
            ll x,y;
            cin>>x>>y;
            update(1,0,n-1,x-1,y);
        }
        else{
            ll x,y;
            cin>>x>>y;
            cout<<query(1,0,n-1,x-1,y-1)<<"\n";
        }
    }
}
#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;
}