#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
const ll N=2e5+5;
ll a[N],b[N],c[N],y,z,t[4*N],t1[4*N],x,n,q,mx,mn,k,ans,ind,l,r;
pair <ll,ll> p1[N],p2[N];
bool ok,okk;
void updateluwi(int idx,int tl,int tr,int ind,int val){
if (tr-tl==1) {
t[idx]=val; return ;
}
int tm=(tl+tr)/2;
if (ind<tm) updateluwi(idx*2,tl,tm,ind,val); else updateluwi(idx*2+1,tm,tr,ind,val);
t[idx]=(t[idx*2]^t[idx*2+1]);
}
void updatekenti(int idx,int tl,int tr,int ind,int val){
if (tr-tl==1) {
t1[idx]=val; return ;
}
int tm=(tl+tr)/2;
if (ind<tm) updatekenti(idx*2,tl,tm,ind,val); else updatekenti(idx*2+1,tm,tr,ind,val);
t1[idx]=(t1[idx*2]^t1[idx*2+1]);
}
ll queryluwi(int idx,int tl,int tr,int l,int r){
if (tl>=r || tr<=l) return 0;
if (l<=tl && tr<=r) return t[idx];
int tm=(tl+tr)/2;
return (queryluwi(idx*2,tl,tm,l,r)^queryluwi(idx*2+1,tm,tr,l,r));
}
ll querykenti(int idx,int tl,int tr,int l,int r){
if (tl>=r || tr<=l) return 0;
if (l<=tl && tr<=r) return t1[idx];
int tm=(tl+tr)/2;
return (querykenti(idx*2,tl,tm,l,r)^querykenti(idx*2+1,tm,tr,l,r));
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
cin >> n >> q;
for (int i=1; i<=n; i++) cin >> a[i];
for (int i=1; i<=n; i++){
if (i%2==1) updatekenti(1,1,n+1,i,a[i]);
else updateluwi(1,1,n+1,i,a[i]);
}
while (q--){
cin >> x;
if (x==1){
cin >> y >> z;
if (y%2==0) updateluwi(1,1,n+1,y,z); else updatekenti(1,1,n+1,y,z);
continue;
}
cin >> l >> r;
if ((r-l+1)%2==0) ans=0;
else{
if (l%2==0) ans=queryluwi(1,1,n+1,l,r+1); else ans=querykenti(1,1,n+1,l,r+1);
}
cout << ans << endl;
}
}