#include <bits/stdc++.h>
// #include <atcoder/all>
// #include "icld.cpp"
using namespace std;
using ll = long long int;
using vi = vector<int>;
using si = set<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using ss = string;
using db = double;
template<typename T> using minpq = priority_queue <T,vector<T>,greater<T>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
#define V vector
#define P pair<int,int>
#define PLL pair<ll,ll>
#define rep(i,s,n) for(int i=(s);i<(int)(n);i++)
#define rev(i,s,n) for(int i=(s);i>=(int)(n);i--)
#define reciv(v,n) vll (v)((n)); rep(i,0,(n))cin>>v[i]
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ci(x) cin >> x
#define cii(x) ll x;cin >> x
#define cci(x,y) ll x,y;cin >> x >> y
#define co(x) cout << x << endl
#define pb push_back
#define eb emplace_back
#define rz resize
#define pu push
#define sz(x) int(x.size())
#define vij v[i][j]
// ll p = 1e9+7;
// ll p = 998244353;
// n do -> n*pi/180
#define yn cout<<"Yes"<<endl;else cout<<"No"<<endl
#define YN cout<<"YES"<<endl;else cout<<"NO"<<endl
template<class T>void chmax(T &x,T y){x=max(x,y);}
template<class T>void chmin(T &x,T y){x=min(x,y);}

vi bt;
int m=1;
// i -> vi
void init(int i,int x){
  // place
  int now=i+m-1;
  // operate
  bt[now]^=x;

  while(now){
    int par=(now-1)/2;
    int chi=par*2+1;
    if(now==chi)chi++;

    bt[par]=bt[now]^bt[chi];
    now=par;
  }
}

int f(int s,int t,int now=0,int l=0,int r=m){
  // 完全に違う時
  if(r<=s or t<=l)return 0;
  // 完全に収まりきってる時
  if(s<=l and r<=t)return bt[now];

  int hf=(l+r)/2;
  int cl=f(s,t,now*2+1,l,hf);
  int cr=f(s,t,now*2+2,hf,r);
  return cl^cr;
}

int main(){
  cci(n,q);
  reciv(v,n);

  while(m<n)m*=2;
  // 初期化
  bt.rz(m*2-1,0);

  rep(i,0,n){
    // 代入と同時にテーブル造り
    // ２回更新されていくことになるが確実
    init(i,v[i]);
  }

  vi res;
  rep(i,0,q){
    cii(t);
    cci(x,y);
    x--;

   if(t==1)init(x,y);

    else {
      int ans=f(x,y,0,0,m);
      res.pb(ans);
    }
  }

  for(int ans:res)co(ans);
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pll;
typedef pair<ll,pair<ll,ll>>plll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
#define vll(v) v.begin(),v.end()
#define all(x) x.rbegin(),x.rend()
#define min3(a, b, c)   min(a, min(b, c))
#define max3(a, b, c)   max(a, max(b, c))
#define F first
#define S second
#define in  freopen("input.txt", "r", stdin)
#define out  freopen("output.txt", "w", stdout)
#define minheap int,vector<int>,greater<int>
#define pb push_back
#define eb emplace_back
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define bug cout<<"BUG"<<endl;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const double PI  =3.141592653589793238463;
bool compare(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
       return (a.first > b.first);
}
ll lcm(ll a,ll b)
{
    if(a==0 || b==0)return 0;

    return a/__gcd(a,b)*b;
}

void input(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)cin>>ara[i];
}
void print(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)
        cout<<ara[i]<<" ";
    cout<<endl;
}



ll tree[300010];

ll query(ll idx)
{
    ll sum=0;

    while(idx>0)
    {
        sum^=tree[idx];

        idx-= idx & (-idx);

    }

    return sum;
}

void update(ll idx,ll x,ll n)
{
    while(idx<=n)
    {
        tree[idx]^=x;

        idx+= idx & (-idx);
    }
}



int main()
{

   fastread();

   ll i,j,n,m,p,a,sum=0,k,t,b,c,d,cnt=0,q,l,r,ans=0;

      bool flag=false;

      string str;

      cin>>n>>t;

      ll ara[n+2];

      for(i=1; i<=n; i++)
        {
            cin>>ara[i];

            update(i,ara[i],n);
        }


      ll test;

      while(t--)
      {

            cin>>test>>a>>b;

            if(test==1)
            {
                update(a,ara[a],n);

                ara[a]=(ara[a]^b);

                update(a,ara[a],n);
            }
            else
            {
                cout<<(query(b)^query(a-1))<<endl;
            }
      }





}

