# include using namespace std; const int MAXN = 1e6; int a[MAXN]; vector g[MAXN]; int br = 0; int in[MAXN],out[MAXN]; void dfs(int v) { br++; in[v] = br; for(auto u:g[v]) { if(in[u])continue; dfs(u); } out[v] = br; } int segm[MAXN],lazy[MAXN]; void update_lazy(int v, int from, int to) { if(lazy[v]==0)return ; segm[v] = segm[v]^lazy[v]; if(from!=to); lazy[2*v]^=lazy[v]; lazy[2*v+1]^=lazy[v]; lazy[v] = 0; } int query(int v, int from, int to, int x) { update_lazy(v,from,to); if(from==to) return segm[v]; int mid = (from+to)/2;; if(x<=mid)return query(2*v,from,mid,x); else return query(2*v+1,mid+1,to,x); } void update(int v, int from, int to, int l, int r, int delta) { update_lazy(v,from,to); if(l<=from&&to<=r) { lazy[v] ^= delta; update_lazy(v,from,to); return ; } int mid = (from+to)/2; if(l<=mid) update(2*v,from,mid,l,r,delta); if(r>mid) update(2*v+1,mid+1,to,l,r,delta); return ; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); freopen ("xor.in","r",stdin); freopen ("xor.out","w",stdout); int n,q; cin >> n >> q; int i,j,u,v; for(i = 1;i<=n;i++) cin>>a[i]; for(i=1;i>u>>v; g[u].push_back(v); g[v].push_back(u); } dfs(1); int type; for(i = 1;i<=n;i++) { update(1,1,n,in[i],out[i],a[i]); } for(i = 1;i <= q; i++) { cin>>type >> u; if(type==1) { cin>>v; int x = a[u]; x = x^v; update(1,1,n,in[u],out[u],x); a[u] = v; } else { cout<