#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(),(a).end() template struct BIT { vector data; int siz; BIT(int n) { siz = n; data.assign(siz + 1, 0); } BIT(int n, const vector &v) : BIT(n) { assert(n == (int)v.size()); for (int i = 1; i <= siz; ++i) data[i] = v[i - 1]; for (int i = 1; i <= siz; ++i) { int j = i + (i & -i); if (j <= siz) data[j] ^= data[i]; } } void apply(int i, const T &x) { for (int k = i + 1; k <= siz; k += k & -k) data[k] ^= x; } T sum(int a) { T res = 0; for (int k = a + 1; k > 0; k -= k & -k) res ^= data[k]; return res; } T sum(int a, int b) { return (sum(b) ^ sum(a)); } }; void dfs(int N, int v, vector> &G, vector &seen, vector &tour) { seen[v] = true; tour.push_back(v); for (int next : G[v]) { if (seen[next]) continue; dfs(N, next, G, seen, tour); } tour.push_back(v + N); } int main() { cin.tie(nullptr); int N, Q; cin >> N >> Q; vector C(N); rep(i, 0, N) cin >> C[i]; vector> G(N, vector()); rep(i, 0, N - 1) { int a, b; cin >> a >> b; a--, b--; G[a].push_back(b); G[b].push_back(a); } vector tour; vector seen(N, false); dfs(N, 0, G, seen, tour); vector tmp, in(N), out(N); rep(i, 0, 2 * N) { if (tour[i] < N) { in[tour[i]] = tmp.size(); tmp.push_back(C[tour[i]]); } else { out[tour[i] - N] = tmp.size() - 1; } } BIT bit(N, tmp); rep(query, 0, Q) { int T, x, y; cin >> T >> x >> y; if (T == 1) { bit.apply(in[x - 1], y); } else { cout << bit.sum(in[x - 1] - 1, out[x - 1]) << '\n'; } } }