#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define eps 1e-9
#define rep(i,l,r) for(int i=l;i<r;i++)
#define rrep(i,r,l) for(int i=r-1;i>=l;i--)
typedef long long ll;
const int maxn=3e5+5;
int n,q,b[maxn];
struct Node{
	int l,r,val,mid;
	void update(int x){
		val^=x;
	}
}a[maxn<<2];
void push_up(int x)
{
	a[x].val=a[x<<1].val^a[x<<1|1].val;
}
void build(int x,int l,int r)
{
	a[x].l=l,a[x].r=r,a[x].mid=(l+r)>>1;
	if(l!=r){
		int mid=a[x].mid;
		build(x<<1,l,mid);
		build(x<<1|1,mid+1,r);
		push_up(x);
	}
	else a[x].val=b[l];
}
void update(int x,int pos,int val)
{
	a[x].update(val);
	int l=a[x].l,r=a[x].r;
	if(l!=r){
		int mid=a[x].mid;
		if(pos<=mid) update(x<<1,pos,val);
		else update(x<<1|1,pos,val);
	}
}
int query(int x,int l,int r)
{
	int L=a[x].l,R=a[x].r;
	if(l<=L&&R<=r) return a[x].val;
	else {
		int mid=a[x].mid,ans=0;
		if(l<=mid) ans^=query(x<<1,l,r);
		if(r>mid) ans^=query(x<<1|1,l,r);
		return ans;
	}
}
int main()
{
	cin>>n>>q;
	rep(i,1,n+1) cin>>b[i];
	build(1,1,n);
	while(q--){
		int t,x,y;
		cin>>t>>x>>y;
		if(t==1) update(1,x,y);
		else cout<<query(1,x,y)<<endl;
	}
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
int x, y;
  cin >> x >> y;
  vector<vector<int>> cyancheck(51, vector<int>(51));
  cyancheck.at(x).at(y) = 1;
  int k = 2;
  vector<vector<int>> cyanmond(51, vector<int>(51));
    for (int i = 0; i < 50; i++) {
    for (int j = 0; j < 50; j++) {
      cin >> cyanmond.at(i).at(j);
      if(!(j == 0)){
      if(cyanmond.at(i).at(j) == cyanmond.at(i).at(j - 1)){
        cyancheck.at(i).at(j) = k;
        cyancheck.at(i).at(j - 1) = k;
        k++;
      }
      }
      if(!(i == 0)){
      if(cyanmond.at(i).at(j) == cyanmond.at(i - 1).at(j)){
        cyancheck.at(i).at(j) = k;
        cyancheck.at(i - 1).at(j) = k;
        k++;
      }
      }
      
    }
  }

  if(x > 25 && y < 25){
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x - 1).at(y)) && !(cyancheck.at(x - 1).at(y) == 1)){
      cout << "U";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x - 1).at(y) = 1;
      x = x - 1;}
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x).at(y + 1)) && !(cyancheck.at(x).at(y + 1) == 1)){
      cout << "R";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x).at(y + 1) = 1;
      y = y + 1;       
    }
    }
    if(x <= 25 && y < 25){
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x + 1).at(y)) && !(cyancheck.at(x + 1).at(y) == 1)){
      cout << "D";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x + 1).at(y) = 1;
      x = x + 1;}
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x).at(y + 1)) && !(cyancheck.at(x).at(y + 1) == 1)){
      cout << "R";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x).at(y + 1) = 1;
      y = y + 1; 
    }
    }
  
    if(x > 25 && y >= 25){
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x - 1).at(y)) && !(cyancheck.at(x - 1).at(y) = 1)){
      cout << "U";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x - 1).at(y) = 1;
      x = x - 1;}
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x).at(y - 1)) && !(cyancheck.at(x).at(y - 1) == 1)){
      cout << "L";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x).at(y + 1) = 1;
      y = y + 1; 
    }
    }
       if(x <= 25 && y >= 25){
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x + 1).at(y)) && !(cyancheck.at(x + 1).at(y) == 1)){
      cout << "D";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x + 1).at(y) = 1;
      x = x + 1;}
    if(!(cyanmond.at(x).at(y) == cyanmond.at(x).at(y - 1)) && !(cyancheck.at(x).at(y - 1) == 1)){
      cout << "L";
      cyancheck.at(x).at(y) = 1;
      cyancheck.at(x).at(y - 1) = 1;
      y = y - 1; 
    }
    }
 
}
