#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define f(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
using namespace std;
void build_segment_tree(ll arr[],ll tree[],ll n)
{
for(int i=0;i<n;i++)
{
tree[n+i]=arr[i];
}
for(int i=n-1; i>0 ;i--)
{
tree[i]=tree[2*i]^tree[(2*i)+1];
}
}
// update arr[index]=arr[index]^value, and make changes accordingly to the segment tree
void update_segment_tree(int index,ll value,ll n,ll tree[])
{
tree[index+n]=tree[index+n]^value;
index=index+n;
for(int i=index;i>=1;i=i/2)
{
tree[i/2]=tree[i]^tree[i^1];
}
}
// query for interval [l,r)
ll query(int l,int r,ll tree[],ll n)
{
ll res=0LL;
for(l=l+n,r=r+n;l<r;l=l/2,r=r/2)
{
if(l%2==1)
{
res=res^tree[l++];
}
if(r%2==1)
{
res=res^tree[--r];
}
}
return res;
}
void test(){
ll n,q;
cin>>n>>q;
ll arr[n];
f(i,n)cin>>arr[i];
ll tree[2*n];
build_segment_tree(arr,tree,n);
while(q--){
ll t,x,y;
cin>>t>>x>>y;
if(t==1){
update_segment_tree(x-1,y,n,tree);
}else{
ll qu = query(x-1,y,tree,n);
cout<<qu<<"\n";
}
}
}
int main(){
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int tests=1;
// cin>>tests;
while(tests--){
test();
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBsbCBsb25nIGxvbmcgCiNkZWZpbmUgbXAgbWFrZV9wYWlyIAojZGVmaW5lIGYoaSxuKSBmb3IoaW50IGk9MDtpPG47aSsrKSAKI2RlZmluZSBGIGZpcnN0IAojZGVmaW5lIFMgc2Vjb25kIAojZGVmaW5lIHBiIHB1c2hfYmFjayAKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIGJ1aWxkX3NlZ21lbnRfdHJlZShsbCBhcnJbXSxsbCB0cmVlW10sbGwgbikKewogICAgZm9yKGludCBpPTA7aTxuO2krKykKICAgIHsKICAgICAgICB0cmVlW24raV09YXJyW2ldOwogICAgfQogICAgCiAgICBmb3IoaW50IGk9bi0xOyBpPjAgO2ktLSkKICAgIHsKICAgICAgICB0cmVlW2ldPXRyZWVbMippXV50cmVlWygyKmkpKzFdOwogICAgfQp9CgovLyB1cGRhdGUgYXJyW2luZGV4XT1hcnJbaW5kZXhdXnZhbHVlLCBhbmQgbWFrZSBjaGFuZ2VzIGFjY29yZGluZ2x5IHRvIHRoZSBzZWdtZW50IHRyZWUKdm9pZCB1cGRhdGVfc2VnbWVudF90cmVlKGludCBpbmRleCxsbCB2YWx1ZSxsbCBuLGxsIHRyZWVbXSkKewogICAgdHJlZVtpbmRleCtuXT10cmVlW2luZGV4K25dXnZhbHVlOwogICAgaW5kZXg9aW5kZXgrbjsKICAgIAogICAgZm9yKGludCBpPWluZGV4O2k+PTE7aT1pLzIpCiAgICB7CiAgICAgICAgdHJlZVtpLzJdPXRyZWVbaV1edHJlZVtpXjFdOwogICAgfQp9CgovLyBxdWVyeSBmb3IgaW50ZXJ2YWwgW2wscikKbGwgcXVlcnkoaW50IGwsaW50IHIsbGwgdHJlZVtdLGxsIG4pCnsKICAgIGxsIHJlcz0wTEw7CiAgICBmb3IobD1sK24scj1yK247bDxyO2w9bC8yLHI9ci8yKQogICAgewogICAgICAgIGlmKGwlMj09MSkKICAgICAgICB7CiAgICAgICAgICAgIHJlcz1yZXNedHJlZVtsKytdOwogICAgICAgIH0KICAgICAgICBpZihyJTI9PTEpCiAgICAgICAgewogICAgICAgICAgICByZXM9cmVzXnRyZWVbLS1yXTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gcmVzOwp9Cgp2b2lkIHRlc3QoKXsKCWxsIG4scTsKCWNpbj4+bj4+cTsKCWxsIGFycltuXTsKCWYoaSxuKWNpbj4+YXJyW2ldOwoJbGwgdHJlZVsyKm5dOwoJYnVpbGRfc2VnbWVudF90cmVlKGFycix0cmVlLG4pOwoJd2hpbGUocS0tKXsKCQls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