#include<bits/stdc++.h>
using namespace std;
struct zz
{
long long num;
long long f;
}tree[300005];
long long n,m,x,a,b,out[500005],outl;
void cn(long long a,long long b)
{
tree[a].f=b;
}
void q(long long a,long long ans)
{
// cout<<":"<<ans<<endl;
if(!tree[a].f)
{
out[outl]=ans;
outl++;
return;
}
else
{
q(tree[a].f,ans^tree[tree[a].f].num);
}
}
int main(){
freopen("td.in","r",stdin);
freopen("td.out","w",stdout);
cin>>n>>m;
for(long long i=1;i<=n;i++) cin>>tree[i].num;
for(long long i=0;i<m;i++)
{
cin>>x;
if(x-1)
{
cin>>a;
q(a,tree[a].num);
}
else
{
cin>>a>>b;
cn(a,b);
}
}
for(long long i=0;i<outl;i++)
{
cout<<out[i]<<endl;
}
}