import sys sys.setrecursionlimit(10**9) N,Q=map(int,input().split()) C=list(map(int,input().split())) G=[[] for _ in range(N)] for i in range(N-1): a,b=map(lambda x:int(x)-1,input().split()) G[a].append(b) G[b].append(a) seen=[False]*N par=[-1]*N subtree_xor=C def dfs(G,v,p=-1): seen[v]=True par[v]=p for nextv in G[v]: if nextv!=p: dfs(G,nextv,v) for c in G[v]: if c!=p: subtree_xor[v]^=subtree_xor[c] dfs(G,0) for _ in range(Q): t,x,y=map(int,input().split()) x-=1 if t==1: while x!=-1: subtree_xor[x]^=y x=par[x] else: print(C[x])