//The North remembers
//Denysiuk Illia will win EJOI 2026
//Denysiuk Illia will win UJGOI 2026
//Антон Перебейнис ничего не ботал
#include <algorithm>
#include <algorithm>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
#include <set>
#include <map>
using namespace std;
const long long INF=1e18+10;
const int mod=1e9+7;
const long long maxlog=22;
const int maxc=11;
using victor = vector<int>;
using victorl = vector<long long>;
using dih = deque<int>;
using pii = pair<int,long long>;
using pll=pair<long long,int>;
const int NIGGA=2*1e5+10;
using ver = pair<long long,pair<int,int>>;
int n;
struct node{
long long even,odd;
};
struct segtree{
node T[4*NIGGA];
void init(){
for(int i=0;i<4*NIGGA;i++)T[i]={0,0};
}
node combine(node p1,node p2){
return {p1.even^p2.even,p1.odd^p2.odd};
}
void set(int v,int tl,int tr,int pos,int val){
if(tl==tr){
if(pos%2==0)T[v]={val,0};
else T[v]={0,val};
return;
}
int tm=(tl+tr)/2;
if(pos<=tm)set(2*v+1,tl,tm,pos,val);
else set(2*v+2,tm+1,tr,pos,val);
T[v]=combine(T[2*v+1],T[2*v+2]);
}
node get(int v,int tl,int tr,int l,int r){
if(tr<l || tl>r)return {0,0};
if(l<=tl && tr<=r)return T[v];
int tm=(tl+tr)/2;
return combine(get(2*v+1,tl,tm,l,r),get(2*v+2,tm+1,tr,l,r));
}
void set(int pos,int val){
set(0,0,n-1,pos,val);
}
node get(int l,int r){
return get(0,0,n-1,l,r);
}
};
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int q;
cin>>n>>q;
segtree T;
T.init();
for(int i=0;i<n;i++){
int x;
cin>>x;
T.set(i,x);
}
while(q--){
int type;
cin>>type;
if(type==1){
int pos,val;
cin>>pos>>val;
--pos;
T.set(pos,val);
}
else{
int l,r;
cin>>l>>r;
--l,--r;
if((r-l)%2==1){
cout<<0<<'\n';
continue;
}
else{
node res=T.get(l,r);
if(l%2)cout<<res.odd<<'\n';
else cout<<res.even<<'\n';
}
}
}
return 0;
}