#include<bits/stdc++.h>
using namespace std;
#define dd double
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ll long long
#define ull unsigned long long
#define ld long double
#define mx 300005
#define mod 1000000007
#define fr first
#define cti(a) (a-48)
#define itc(a) char(a+48)
#define se second
#define End cout<<"\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define memo(Array,val) memset(Array, val, sizeof Array)
#define PI acos(-1)
bool check(ll n, ll pos){ return (n&(1<<pos)); }
bool Set(ll n, ll pos) {  return (n | (1<<pos)); }
ld LOG(ld b, ld e){ return log(b)/log(e); }

ll a[mx],tree[4*mx],lazy[4*mx];

ll Merge(ll lft, ll rgt)
{
    return lft^rgt;
}

void update(ll node, ll b, ll e, ll i, ll val)
{
    if(i>e || i<b)return;
    if(b>=i && e<=i){
        tree[node]^=val;
        return;
    }
    ll mid=(b+e)/2;
    ll left=node*2;
    ll right=left+1;
    update(left,b,mid,i,val);
    update(right,mid+1,e,i,val);
    tree[node]=Merge(tree[left],tree[right]);
}

ll Query(ll node, ll b, ll e, ll i, ll j)
{
    //relax(node,b,e);
    if(i>e || j<b)return 0;
    if(b>=i && e<=j)return tree[node];

    ll mid=(b+e)/2;
    ll left=node*2;
    ll right=left+1;
    ll p=Query(left,b,mid,i,j);
    ll q=Query(right,mid+1,e,i,j);
    return Merge(p,q);
}

void clr() { memo(tree, 0), memo(lazy, 0), memo(a, 0); }

void solve(int kk)
{
    clr();
    int n,q;
    scanf("%d %d", &n, &q);
    for(int i=1; i<=n; i++){
        scanf("%lld", &a[i]);
        update(1, 1, n, i, a[i]);
    }

    //printf("Case %d:\n", kk);

    while(q--){
        int aa,bb,cc;
        ll val;
        scanf("%d %d %d", &aa, &bb, &cc);
        if(aa == 1){
            update(1, 1, n, bb, cc);
        }
        else printf("%lld\n", Query(1,1,n,bb,cc));
    }

}

int main()
{
   //fast;
   int t=1,kk=0;
   //scanf("%d", &t);
   while(++kk<=t) solve(kk);

   return 0;
}

/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB emplace_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("[DEBUG] ");W(__VA_ARGS__);}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1<<20;
const int BIT_NUM = 20;
struct BIT{
    int _n;
    long long _d[1 << BIT_NUM];
    void init(int __n) {
        _n=__n;
        memset(_d, 0, sizeof(long long) * (_n+1));
    }
    void ins(int x, long long v) {
        for(; x <= _n; x += x & -x) { _d[x] ^= v; }
    }
    long long qq(int x) {
        if(x <= 0) {
            return 0;
        }
        long long res = 0;
        for(; x; x -= x & -x) { res ^= _d[x];}
        return res;
    }
    long long qq_range(int x, int y) {
        if(x > y) {
            return 0;
        }
        long long ret = qq(y);
        if(x)ret ^= qq(x-1);
        return ret;
    }
    long long k_th(int k){
        int now = 0;
        for(int i = BIT_NUM - 1; i >= 0; i--) {
            if(_d[now + (1 << i)] < k) {
                k -= _d[now + (1 << i)];
                now += 1 << i;
            }
        }
        return now + 1;
    }
}bit;
int N, Q;
void solve() {
    FOR(i, 1, Q) {
        int ty, x, y;
        R(ty, x, y);
        if(ty == 1) {
            bit.ins(x, y);
        } else {
            W(bit.qq_range(x, y));
        }
    }
}
void input() {
    R(N, Q);
    bit.init(N);
    FOR(i, 1, N) {
        int x;
        R(x);
        bit.ins(i, x);
    }
}
int main(){
    input();
    solve();
    return 0;
}
