#include<bits/stdc++.h>

using namespace std;

/**templates**/
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;

#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define sull(x) scanf("%llu",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf(" %s",x)
#define sc(x) scanf(" %c",&x)
#define pi acos(-1.0)
#define pb push_back
#define aa first
#define bb second
#define sz(x) (ll)(x).size()
#define cas printf("Case %lld: ",++t)
#define casline printf("Case %lld:\n",++t)
//#define cas cout<<"Case "<<++t<<": "
//#define casline cout<<"Case "<<++t<<":"<<endl;
#define distance(x1,y1,x2,y2)((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
#define endl "\n"
#define bug cout<<"bugggggggggggg "<<endl;
#define fast ios_base::sync_with_stdio(0);cin.tie(nullptr); ///no printf/scanf
#define clean fflush(stdout)

const ll mod = 1000000007;
const ll inf = 1LL<<62;
const ll mx = 100005;
const double eps = 1e-10;

ll dx[10]={1,0,-1,0};
ll dy[10]={0,-1,0,1};
///ll dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; /// 8 Direction
///ll dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; /// Knight Direction

ll power(ll a,ll b)
{
    if(b==0)return 1;
    ll x=power(a,b/2);
    x=x*x;
    if(b%2)x=x*a;
    return x;
}

ll bigmod(ll a,ll b)
{
    if(b==0)return 1;
    ll x=bigmod(a,b/2)%mod;
    x=(x*x)%mod;
    if(b%2)x=(x*a)%mod;
    return x;
}

ll Set(ll N,ll pos){return N=N | (1LL<<pos);}
ll reset(ll N,ll pos){return N= N & ~(1LL<<pos);}
bool check(ll N,ll pos){return (bool)(N & (1LL<<pos));}

/**
        ...ENDING OF TEMPLATE...
*/

ll arr[3*mx];
ll tree[4*3*mx];
void build(ll at,ll L,ll R)
{
    if(L==R)
    {
        tree[at]=arr[L];
        return;
    }
    ll mid=(L+R)/2;
    build(2*at,L,mid);
    build(2*at+1,mid+1,R);
    tree[at]=tree[2*at]^tree[2*at+1];
}
void update(ll at,ll L,ll R,ll id,ll val)
{
    if(R<id||L>id)return;
    if(L==R&&id==R)
    {
        tree[at]^=val;
        return;
    }
    ll mid=(L+R)/2;
    update(2*at,L,mid,id,val);
    update(2*at+1,mid+1,R,id,val);
    tree[at]=tree[2*at]^tree[2*at+1];
}
ll query(ll at,ll L,ll R,ll l,ll r)
{
    if(l>R||r<L)return 0;
    if(l<=L&&r>=R)return tree[at];
    ll mid=(L+R)/2;
    ll a=query(2*at,L,mid,l,r);
    ll b=query(2*at+1,mid+1,R,l,r);
//    cout<<a+b<<endl;
    return a^b;
}

int main()
{
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    fast; ///no printf/scanf
    /** Use "long double"(%Lf) instead of double for precision safety*/
    ll tst,a,b,c,k,n,m,res=1,ans=0,t=0;
    sl(n),sl(m);
    for(ll i=1;i<=n;i++)
    {
        sl(arr[i]);
    }
    build(1,1,n);
    while(m--)
    {
        sl(c),sl(a),sl(b);
        if(c==1)
        {
            update(1,1,n,a,b);
        }
        else
        {
            res=query(1,1,n,a,b);
            printf("%lld\n",res);
        }
    }



    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 3e5+5;

ll n , m , q , a[N] , BIT[N];

void update(int idx , ll val)
{
    a[idx] = val;

    for(idx; idx<=n; idx = (idx + (idx&-idx)))
    {
        BIT[idx] ^= val;
    }
}

ll query(int idx)
{
    ll res = 0;
    for(idx; idx; idx = (idx - (idx&-idx)))
    {
        res ^= BIT[idx];
    }
    return res;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> n >> q;
    for(int i=1; i<=n; i++)
    {
        cin >> a[i];
        update(i , a[i]);
    }

    while(q--)
    {
        ll t , l , r;
        cin >> t >> l >> r;
        if (t==1)
        {
            update(l , r);
        }
        else
        {
            cout << (query(r)^query(l-1)) << '\n';
        }
    }

    return 0;
}