/*************************************************************************
    > File Name: F.cpp
    > Author: Bran
    > Mail: 1811161330@qq.com 
    > Created Time: 2020/12/19 23:11:30
 ************************************************************************/

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define fr first
#define sc second
#define rep(i,x,n) for (int i = x; i < n; ++i)

using namespace std;
using LL = long long;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;

struct segtree {
        int size;
        vector<int> sums;

        void init(int n) {
                size = 1;
                while (size < n) size <<= 1;
                sums.assign(2 * size, 0);
        }

        void build(vector<int>& a, int cur, int l, int r) {
                if (l + 1 == r) {
                        if (l < a.size()) sums[cur] = a[l];
                        return ;
                }

                int m = (l + r) / 2;
                build(a, cur * 2 + 1, l, m);
                build(a, cur * 2 + 2, m, r);
                sums[cur] = sums[cur * 2 + 1] ^ sums[cur * 2 + 2];
        }

        void build(vector<int>& a) {
                build(a, 0, 0, size);
        }

        void set(int i, int val, int cur, int l, int r) {
                if (l + 1 == r) {
                        sums[cur] ^= val;
                        return ;
                }

                int m = (l + r) / 2;
                if (i < m) set(i, val, cur * 2 + 1, l, m);
                else set(i, val, cur * 2 + 2, m, r);
                sums[cur] = sums[cur * 2 + 1] ^ sums[cur * 2 + 2];
        }

        void set(int i, int val) {
                set(i, val, 0, 0, size);
        }

        int query(int a, int b, int cur, int l, int r) {
                if (r <= a || l >= b) return 0;
                if (l >= a && r <= b) return sums[cur];

                int m = (l + r) / 2;
                return query(a, b, cur * 2 + 1, l, m) ^ query(a, b, cur * 2 + 2, m, r);
        }

        int query(int a, int b) {
                return query(a, b, 0, 0, size);
        }
}st;

void solve() {
        int n, q;
        scanf("%d%d", &n, &q);
        vector<int> a(n);
        rep(i, 0, n) scanf("%d", &a[i]);
        st.init(n);
        st.build(a);
        rep(i, 0, q) {
                int t, b, c;
                scanf("%d%d%d", &t, &b, &c);
                if (t == 1) st.set(b - 1, c);
                else printf("%d\n", st.query(b - 1, c));
        }
}

int main() {
        solve();
        return 0;
}

#include<bits/stdc++.h>
//#include<atcoder/all>

using namespace std;
//using namespace atcoder;

//https://algo-logic.info/segment-tree/#toc_id_3_2
template <typename X>
struct SegTree {
    using FX = function<X(X, X)>; // X•X -> X となる関数の型
    int n;
    FX fx;
    const X ex;
    vector<X> dat;
    SegTree(int n_, FX fx_, X ex_) : n(), fx(fx_), ex(ex_), dat(n_ * 4, ex_) {
        int x = 1;
        while (n_ > x) {
            x *= 2;
        }
        n = x;
    }
    void set(int i, X x) { dat[i + n - 1] = x; }
    void build() {
        for (int k = n - 2; k >= 0; k--) dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]);
    }
    void update(int i, X x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;  // parent
            dat[i] = fx(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
    X query_sub(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) {
            return ex;
        } else if (a <= l && r <= b) {
            return dat[k];
        } else {
            X vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
            X vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
            return fx(vl, vr);
        }
    }
};

int main(){
    int N,Q;
    cin>>N>>Q;
    auto fx = [](int x1, int x2) -> int { return x1^x2; };
    int ex = 0;
    SegTree<int> rmq(N+5, fx, ex);

    for(int i=1;i<=N;i++){
        int A;
        cin>>A;
        rmq.update(i,A);
    }

    for(int i=0;i<Q;i++){
        int T,X,Y;
        cin>>T>>X>>Y;
        if(T==1){
            rmq.update(X,rmq.query(X,X+1)^Y);
        }
        else{
            cout<<rmq.query(X,Y+1)<<endl;
        }
    }
}
