#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

template <typename T> struct SegmentTree {
  using F = function<T(T, T)>;
  T n;
  vector<T> d;
  const F f;
  const T e;

  // 要素数, 操作関数, 単位元
  SegmentTree(T m, F f, T e) : f(f), e(e) {
    n = 1;
    while (n < m) n *= 2;
    d = vector<T>(2 * n, e);
  }

  void update(int i, T x) {
    i += n;
    d[i] = x;
    while (i > 1) {
      i /= 2;
      d[i] = f(d[2 * i], d[2 * i + 1]);
    }
  }

  // [a, b)
  T query(int a, int b) { return query_sub(a, b, 1, 0, n); }
  T query_sub(int a, int b, int k, int l, int r) {
    // index k: [l, r)
    if (r <= a || b <= l) return e;
    if (a <= l && r <= b) return d[k];
    T lv = query_sub(a, b, 2 * k, l, (l + r) / 2);
    T rv = query_sub(a, b, 2 * k + 1, (l + r) / 2, r);
    return f(lv, rv);
  }

  T get(int i) { return d[n + i]; }
};

int f(int x, int y) { return x ^ y; }

int main() {
  int n, q;
  cin >> n >> q;
  SegmentTree<int> st(n, f, 0);
  rep(i, n) {
    int a;
    cin >> a;
    st.update(i, a);
  }

  rep(iq, q) {
    int t, x, y;
    cin >> t >> x >> y;
    --x;
    if (t == 1) {
      st.update(x, st.get(x) ^ y);
    } else {
      printf("%d\n", st.query(x, y));
    }
  }
  return 0;
}

#include "bits/stdc++.h"
using namespace std;
#define dbg(var) cout<<#var<<"="<<var<<" "
#define nl cout<<"\n"
#define fr(i,n) for(int i=0;i<n;i++)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(v) (int)(v.size())
#define int long long
#define kill(x) { cout << x << "\n"; return;}
const int N=3e5+100;
int B[N];
int sm(int i){int r=0;for(;i;i-=i&-i)r^=B[i];return r;}
void up(int i,int v){for(;i<N;i+=i&-i)B[i]^=v;}
int vid(int i){int r=B[i],z=i-(i&-i);for(i--;i!=z;i-=i&-i)r-=B[i];return r;}
int rsm(int l,int r){return sm(r)^sm(l-1);} 
void solve(){
	int n,m; cin >> n >>m ;
	int x;
	fr(i,n) { cin >> x; up(i+1,x);}
	while(m--){
		int t,y; cin >> t >> x >> y;
		if(t & 1) {
			up(x,y);
		}
		else cout << rsm(x,y) << "\n";
	}

}
int32_t main()
{
   ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
   // int tst; cin >> tst; while(tst--)
   {
   	solve();
   }
}