#include <bits/stdc++.h>

#if DEBUG && !ONLINE_JUDGE
    #include "debug.h"
#else
    #define debug(...)
#endif

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/
#define scd(t) scanf("%d",&t)
#define scld(t) scanf("%ld",&t)
#define sclld(t) scanf("%lld",&t)
#define scc(t) scanf("%c",&t)
#define scs(t) scanf("%s",t)
#define scf(t) scanf("%f",&t)
#define sclf(t) scanf("%lf",&t)
#define mem(a, b) memset(a, (b), sizeof(a))
#define repd(i,k) for(ll i=k;i>=0;i--)
#define rep(i,k) for(ll i=0;i<k;i++)
#define repn(i,k1,k2) for(ll i=k1;i<=k2;i++)

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define in(A, B, C) assert( B <= A && A <= C)
#define mp make_pair
#define pb push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define ee6 (ll)1000001
#define ee5 (ll)100001
#define read(type) readInt<type>()
#define tt ll t;cin>>t; while(t--)
typedef long long int ll;

typedef pair<ll, ll> pr;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<pr> vpr;
typedef vector<vpr>vvpr;
typedef vector<vi> vvi;
typedef map<ll,ll> MPII;
typedef set<ll> SETI;
typedef multiset<ll> MSETI;

 const ll N=2*ee5;
 ll o=1,e=1;
 ll evenst[N],oddst[N],dep[N],firstchild[N],pos[N],ODD[N],EVEN[N],val[N];
vvi g(N);
void dfs(ll v,ll p)
{
	if(dep[v]%2){pos[v]=o;o++;}
	else {pos[v]=e;e++;}

	for(auto i:g[v])
	{
		if(i==p)continue;
		dep[i]=1+dep[v];
		dfs(i,v);
		if(firstchild[v]==-1)
		firstchild[v]=i;
		evenst[v]+=evenst[i];oddst[v]+=oddst[i];
	}
	if(dep[v]%2)oddst[v]++;else evenst[v]++;
}

ll add(ll in,ll val,ll v[])
{
	while(in<=200001)
	{
		v[in]+=val;
		in+=(in&-in);
	}
}

ll sum(ll in,ll v[])
{
	ll s=0;
	while(in>0)
	{
		s+=v[in];
		in-=(in&-in);
	}
	return s;
}

int main()
{
	#if !ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	mem(firstchild,-1);

	ll n,m;cin>>n>>m;rep(i,n)cin>>val[i];
	rep(i,n-1)
	{ll x,y;cin>>x>>y;x--;y--;g[x].pb(y);g[y].pb(x);}
	dfs(0,-1);
	rep(i,m)
	{
		ll op,x;cin>>op>>x;x--;
		if(op==1)
		{
			ll val;cin>>val;
			if(dep[x]%2){
				add(pos[x],val,ODD);add(pos[x]+oddst[x],-val,ODD);
				if(firstchild[x]==-1)continue;
				add(pos[firstchild[x]],-val,EVEN);add(pos[firstchild[x]]+evenst[x],val,EVEN);
			}
			else
			{
				add(pos[x],val,EVEN);add(pos[x]+evenst[x],-val,EVEN);
				if(firstchild[x]==-1)continue;
				add(pos[firstchild[x]],-val,ODD);add(pos[firstchild[x]]+oddst[x],val,ODD);
			}

		}
		else
		{
			if(dep[x]%2)
				cout<<val[x]+sum(pos[x],ODD)<<"\n";
			else cout<<val[x]+sum(pos[x],EVEN)<<"\n";
		}
	}

}


#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 2e5 + 5, M = 2 * N + 5;

int head[N], to[M], nxt[M], ne, n;

void init(){
    ne = 0;
    memset(head, -1, n * sizeof head[0]);
}

void addEdge(int f, int t){
    to[ne] = t;
    nxt[ne] = head[f];
    head[f] = ne++;
}

void addBiEdge(int a, int b){
    addEdge(a, b);
    addEdge(b, a);
}

int dep[N];
int in[N], out[N], id(-1);

int nodes[N], sz;

void dfs(int u = 0, int par = -1, int l = 0){
    dep[u] = l;
    in[u] = ++id;
    nodes[sz++] = u;
    for(int e = head[u] ; ~e ; e = nxt[e]){
        int v = to[e];
        if(v == par)continue;
        dfs(v, u, l + 1);
    }
    out[u] = id;
}

int a[N];
ll tree[N][2], lazy[N][2];

void pre(){
    dfs();
}

void pushDown(int ni, int ns, int ne, int id){
    if(ns != ne){
        lazy[ni * 2][id] += lazy[ni][id];
        lazy[ni * 2 + 1][id] += lazy[ni][id];
    }
    else if((id & 1) == (dep[nodes[ns]] & 1))
        tree[ni][id] += lazy[ni][id];
    lazy[ni][id] = 0;
}

void update(int ni, int ns, int ne, int id, int qs, int qe, int val){
    if(ns > qe || ne < qs)return ;

    if(qs <= ns && ne <= qe){
        lazy[ni][id] += val;
        return ;
    }
    pushDown(ni, ns, ne, id);

    int mid = (ns + (ne - ns) / 2);
    int lf = ni * 2, rt = lf + 1;

    update(lf, ns, mid, id, qs, qe, val);
    update(rt, mid + 1, ne, id, qs, qe, val);
}

ll get(int ni, int ns, int ne, int id, int qi){
    pushDown(ni, ns, ne, id);
    if(ns == ne)
        return tree[ni][id];

    int mid = (ns + (ne - ns) / 2);
    int lf = ni * 2, rt = lf + 1;

    if(mid >= qi)return get(lf, ns, mid, id, qi);
    return get(rt, mid + 1, ne, id, qi);
}

void tst(int ni, int ns, int ne){
    pushDown(ni, ns, ne, 0);
    pushDown(ni, ns, ne, 1);
    if(ns == ne){
        cout << "Idx = " << nodes[ns] + 1 << " --> " << tree[ni][0] << ", " <<  tree[ni][1] << endl;
        return;
    }

    int mid = (ns + (ne - ns) / 2);
    int lf = ni * 2, rt = lf + 1;

    tst(lf, ns, mid);
    tst(rt, mid + 1, ne);
}

int main(){
    int q;
    scanf("%d %d", &n, &q);
    init();
    for(int i = 0 ; i < n ; ++i)
        scanf("%d", a + i);
    for(int i = 1 ; i < n ; ++i){
        int u, v;
        scanf("%d %d", &u, &v);
        addBiEdge(--u, --v);
    }

    pre();

    while(q--){
        int typ, u;
        scanf("%d %d", &typ, &u);
        --u;
        if(typ == 2){
            printf("%lld\n", get(1, 0, n - 1, 0, in[u]) +
                             get(1, 0, n - 1, 1, in[u]) + a[u]);
            continue;
        }
        int val;
        scanf("%d", &val);
        update(1, 0, n - 1, (dep[u] & 1), in[u], out[u], val);
        update(1, 0, n - 1, !(dep[u] & 1), in[u], out[u], -val);
    }
}


#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 2e5 + 5, M = 2 * N + 5;

int head[N], to[M], nxt[M], ne, n;

void init(){
    ne = 0;
    memset(head, -1, n * sizeof head[0]);
}

void addEdge(int f, int t){
    to[ne] = t;
    nxt[ne] = head[f];
    head[f] = ne++;
}

void addBiEdge(int a, int b){
    addEdge(a, b);
    addEdge(b, a);
}

int dep[N];
int in[N], out[N], id(-1);

int nodes[N], sz;

void dfs(int u = 0, int par = -1, int l = 0){
    dep[u] = l;
    in[u] = ++id;
    nodes[sz++] = u;
    for(int e = head[u] ; ~e ; e = nxt[e]){
        int v = to[e];
        if(v == par)continue;
        dfs(v, u, l + 1);
    }
    out[u] = id;
}

int a[N];
ll tree[1 << 19][2], lazy[1 << 19][2];

void pre(){
    dfs();
}

void pushDown(int ni, int ns, int ne, int id){
    if(ns != ne){
        lazy[ni * 2][id] += lazy[ni][id];
        lazy[ni * 2 + 1][id] += lazy[ni][id];
    }
    else if((id & 1) == (dep[nodes[ns]] & 1))
        tree[ni][id] += lazy[ni][id];
    lazy[ni][id] = 0;
}

void update(int ni, int ns, int ne, int id, int qs, int qe, int val){
    if(ns > qe || ne < qs)return ;

    if(qs <= ns && ne <= qe){
        lazy[ni][id] += val;
        return ;
    }
    pushDown(ni, ns, ne, id);

    int mid = (ns + (ne - ns) / 2);
    int lf = ni * 2, rt = lf + 1;

    update(lf, ns, mid, id, qs, qe, val);
    update(rt, mid + 1, ne, id, qs, qe, val);
}

ll get(int ni, int ns, int ne, int id, int qi){
    pushDown(ni, ns, ne, id);
    if(ns == ne)
        return tree[ni][id];

    int mid = (ns + (ne - ns) / 2);
    int lf = ni * 2, rt = lf + 1;

    if(mid >= qi)return get(lf, ns, mid, id, qi);
    return get(rt, mid + 1, ne, id, qi);
}

void tst(int ni, int ns, int ne){
    pushDown(ni, ns, ne, 0);
    pushDown(ni, ns, ne, 1);
    if(ns == ne){
        cout << "Idx = " << nodes[ns] + 1 << " --> " << tree[ni][0] << ", " <<  tree[ni][1] << endl;
        return;
    }

    int mid = (ns + (ne - ns) / 2);
    int lf = ni * 2, rt = lf + 1;

    tst(lf, ns, mid);
    tst(rt, mid + 1, ne);
}

int main(){
    int q;
    scanf("%d %d", &n, &q);
    init();
    for(int i = 0 ; i < n ; ++i)
        scanf("%d", a + i);
    for(int i = 1 ; i < n ; ++i){
        int u, v;
        scanf("%d %d", &u, &v);
        addBiEdge(--u, --v);
    }

    pre();

    while(q--){
        int typ, u;
        scanf("%d %d", &typ, &u);
        --u;
        if(typ == 2){
            printf("%lld\n", get(1, 0, n - 1, 0, in[u]) +
                             get(1, 0, n - 1, 1, in[u]) + a[u]);
            continue;
        }
        int val;
        scanf("%d", &val);
        update(1, 0, n - 1, (dep[u] & 1), in[u], out[u], val);
        update(1, 0, n - 1, !(dep[u] & 1), in[u], out[u], -val);
    }
}


#include <bits/stdc++.h>

//____By:sirjan13____

#define int long long
#define mod 1000000007
#define show(a) for(int i=0;i<a.size();i++) cout<<a[i]<<" ";
#define fi first
#define se second
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long int>
#define pb push_back
#define pi pair<int,int>
#define si set<int>
#define all(v) v.begin(),v.end()
#define sotlaga(v) sort(v.begin(), v.end())
#define sll set<ll>
#define maxheap priority_queue<int>
#define minheap priority_queue<int,vector<int>,greater<int>>
#define mp make_pair
#define fast_io() cin.sync_with_stdio(false);cout.sync_with_stdio(false);
#define long_zero 0ll
#define long_one 1ll
#define N 500005

inline int sbt(int x){return __builtin_popcount(x);}

using namespace std;

int tree[N + 111], n, q;
int a[N + 5], level[N + 13], in[N + 15], out[N + 15];
int clock_ttt;
vector<int> adj[N + 15];

void dfs(int u, int par) {
    in[u] = ++clock_ttt;
    for(auto v:adj[u]){
        if(v == par)
             continue;
        level[v] = level[u] + 1;
        dfs(v, u);
    }
    out[u] = ++clock_ttt;
}

int get(int i) {
    int res = 0;
    for(;i > 0; i -= (i & (-i))) {
        res += tree[i];
    }
    return res;
}

void add(int i, int x) {
    for(; i <= N; i += (i & (-i) ) ) tree[i]+=x;
}

int32_t main() {
    fast_io()

    cin >> n >> q;

    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 0; i < n - 1; i++) {
        int u, v;
        cin >> u >> v;

        adj[u].pb(v);
        adj[v].pb(u);
    }

    level[0] = 0;
    clock_ttt = 0;

    dfs(1, 0);
//    for(int i = 0; i <=n; i++){
//        cout << "in[" << i <<"]: " << in[i] << endl;
//        cout << "out[" << i <<"]: " << out[i] << endl << endl;
//	      cout << level[i] << ",";
//    }
//    cout << endl;
    int ty,l,x;

    while(q--) {
        cin >> ty >> l;

        ty--;
        if(!ty){
            cin >>x;
            if(level[l] & 1) {
                add(in[l], -x);
                add(out[l], x);
            }
            else {
                add(in[l], x);
                add(out[l], -x);
            }
        }
        else {
            if(level[l] & 1) {
                cout << a[l] - get(in[l]) << endl;
            }
            else {
                cout << a[l] + get(in[l]) << endl;
            }
        }
    }

	return 0;
}


#include <bits/stdc++.h>

//____By:sirjan13____

#define int long long
#define mod 1000000007
#define show(a) for(int i=0;i<a.size();i++) cout<<a[i]<<" ";
#define fi first
#define se second
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long int>
#define pb push_back
#define pi pair<int,int>
#define si set<int>
#define all(v) v.begin(),v.end()
#define sotlaga(v) sort(v.begin(), v.end())
#define sll set<ll>
#define maxheap priority_queue<int>
#define minheap priority_queue<int,vector<int>,greater<int>>
#define mp make_pair
#define fast_io() cin.sync_with_stdio(false);cout.sync_with_stdio(false);
#define long_zero 0ll
#define long_one 1ll
#define N 200005

inline int sbt(int x){return __builtin_popcount(x);}

using namespace std;

int tree[N + 111], n, q;
int a[N + 5], level[N + 13], in[N + 15], out[N + 15];
int clock_ttt;
vector<int> adj[N + 15];

void dfs(int u, int par) {
    in[u] = ++clock_ttt;
    for(auto v:adj[u]){
        if(v == par)
             continue;
        level[v] = level[u] + 1;
        dfs(v, u);
    }
    out[u] = ++clock_ttt;
}

int get(int i) {
    int res = 0;
    for(;i > 0; i -= (i & (-i))) {
        res += tree[i];
    }
    return res;
}

void add(int i, int x) {
    for(; i <= N; i += (i & (-i) ) ) tree[i]+=x;
}

int32_t main() {
    fast_io()

    cin >> n >> q;

    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 0; i < n - 1; i++) {
        int u, v;
        cin >> u >> v;

        adj[u].pb(v);
        adj[v].pb(u);
    }

    level[0] = 0;
    clock_ttt = 0;

    dfs(1, 0);
//    for(int i = 0; i <=n; i++){
//        cout << "in[" << i <<"]: " << in[i] << endl;
//        cout << "out[" << i <<"]: " << out[i] << endl << endl;
//	      cout << level[i] << ",";
//    }
//    cout << endl;
    int ty,l,x;

    while(q--) {
        cin >> ty >> l;

        ty--;
        if(!ty){
            cin >>x;
            if(level[l] & 1) {
                add(in[l], -x);
                add(out[l], x);
            }
            else {
                add(in[l], x);
                add(out[l], -x);
            }
        }
        else {
            if(level[l] & 1) {
                cout << a[l] - get(in[l]) << endl;
            }
            else {
                cout << a[l] + get(in[l]) << endl;
            }
        }
    }

	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair<ll, ll>
#define nyan "(=^･ω･^=)"
#define read_input         freopen("in.txt","r", stdin)
#define print_output       freopen("out.txt","w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;

const ll maxn = 2e5+10;
vector<ll> adj[maxn];
ll a[2][maxn], c[maxn];
ll in[maxn], out[maxn], level[maxn];
ll tym = 1;

ll tree[2][4*maxn];
ll lazy[2][4*maxn];

void dfs(ll u, ll par) {
    level[u] = level[par] + 1;
    a[level[u] & 1][tym] = c[u];
    in[u] = tym++;

    for(auto v : adj[u]) {
        if(v == par) continue;
        dfs(v, u);
    } out[u] = tym-1;
}

void build(ll at, ll L, ll R) {
    if(L == R) {
        tree[0][at] = a[0][L];
        tree[1][at] = a[1][L];
        return;
    }
    ll mid = L + R >> 1;
    build(at<<1, L, mid); build(at<<1|1, mid+1, R);
    tree[0][at] = tree[0][at<<1] + tree[0][at<<1|1];
    tree[1][at] = tree[1][at<<1] + tree[1][at<<1|1];
}

void propagate(ll at, ll L, ll R) {
    for(auto i : {0, 1}) {
        if(lazy[i][at] != 0) {
            tree[i][at] += (R-L+1) * lazy[i][at];

            if(L != R) {
                lazy[i][at<<1] += lazy[i][at];
                lazy[i][at<<1|1] += lazy[i][at];
            }
            lazy[i][at] = 0;
        }
    }
}

void update(ll at, ll L, ll R, ll l, ll r, ll v, ll k) {
    propagate(at, L, R);

    if(L > r || R < l) return;
    if(L >= l && R <= r) {
        lazy[k][at] += v;
        propagate(at, L, R);
        return;
    }
    ll mid = L + R >> 1;
    update(at<<1, L, mid, l, r, v, k); update(at<<1|1, mid+1, R, l, r, v, k);

    tree[0][at] = tree[0][at<<1] + tree[0][at<<1|1];
    tree[1][at] = tree[1][at<<1] + tree[1][at<<1|1];
}

ll query(ll at, ll L, ll R, ll l, ll r, ll k) {
    propagate(at, L, R);

    if(L > r || R < l) return 0;
    if(L >= l && R <= r) return tree[k][at];
    ll mid = L + R >> 1;
    return query(at<<1, L, mid, l, r, k) + query(at<<1|1, mid+1, R, l, r, k);
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);

    ll n, q; cin >> n >> q;
    for(ll i = 1; i <= n; i++) cin >> c[i];
    for(ll i = 1, x, y; i < n; i++) {
        cin >> x >> y;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    dfs(1, 0);
    build(1, 1, n);

    while(q--) {
        ll k; cin >> k;
        if(k == 1) {
            ll x, v; cin >> x >> v;

            ll l = level[x] & 1;
            update(1, 1, n, in[x], out[x], v, l);
            update(1, 1, n, in[x], out[x], -v, l^1);
        }
        else {
            ll x; cin >> x;
            cout << query(1, 1, n, in[x], in[x], level[x]&1) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair<ll, ll>
#define nyan "(=^･ω･^=)"
#define read_input         freopen("in.txt","r", stdin)
#define print_output       freopen("out.txt","w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;

const ll maxn = 2e5+10;
vector<ll> adj[maxn];
ll a[2][maxn], c[maxn];
ll in[maxn], out[maxn], level[maxn];
ll tym = 1;

ll tree[2][4*maxn];
ll lazy[2][4*maxn];

void dfs(ll u, ll par) {
    level[u] = level[par] + 1;
    a[level[u] & 1][tym] = c[u];
    in[u] = tym++;

    for(auto v : adj[u]) {
        if(v == par) continue;
        dfs(v, u);
    } out[u] = tym-1;
}

void build(ll at, ll L, ll R) {
    if(L == R) {
        tree[0][at] = a[0][L];
        tree[1][at] = a[1][L];
        return;
    }
    ll mid = L + R >> 1;
    build(at<<1, L, mid); build(at<<1|1, mid+1, R);
    tree[0][at] = tree[0][at<<1] + tree[0][at<<1|1];
    tree[1][at] = tree[1][at<<1] + tree[1][at<<1|1];
}

void propagate(ll at, ll L, ll R) {
    for(auto i : {0, 1}) {
        if(lazy[i][at] != 0) {
            tree[i][at] += (R-L+1) * lazy[i][at];

            if(L != R) {
                lazy[i][at<<1] += lazy[i][at];
                lazy[i][at<<1|1] += lazy[i][at];
            }
            lazy[i][at] = 0;
        }
    }
}

void update(ll at, ll L, ll R, ll l, ll r, ll v, ll k) {
    propagate(at, L, R);

    if(L > r || R < l) return;
    if(L >= l && R <= r) {
        lazy[k][at] += v;
        propagate(at, L, R);
        return;
    }
    ll mid = L + R >> 1;
    update(at<<1, L, mid, l, r, v, k); update(at<<1|1, mid+1, R, l, r, v, k);

    tree[0][at] = tree[0][at<<1] + tree[0][at<<1|1];
    tree[1][at] = tree[1][at<<1] + tree[1][at<<1|1];
}

ll query(ll at, ll L, ll R, ll l, ll r, ll k) {
    propagate(at, L, R);

    if(L > r || R < l) return 0;
    if(L >= l && R <= r) return tree[k][at];
    ll mid = L + R >> 1;
    return query(at<<1, L, mid, l, r, k) + query(at<<1|1, mid+1, R, l, r, k);
}

int main()
{
    ll n, q; cin >> n >> q;
    for(ll i = 1; i <= n; i++) cin >> c[i];
    for(ll i = 1, x, y; i < n; i++) {
        cin >> x >> y;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    dfs(1, 0);
    build(1, 1, n);

    while(q--) {
        ll k; cin >> k;
        if(k == 1) {
            ll x, v; cin >> x >> v;

            ll l = level[x] & 1;
            update(1, 1, n, in[x], out[x], v, l);
            update(1, 1, n, in[x], out[x], -v, l^1);
        }
        else {
            ll x; cin >> x;
            cout << query(1, 1, n, in[x], in[x], level[x]&1) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

LL n , m;
LL ara[ 2*N ];
LL Start[ 2*N ] , Finish[ 2*N ] , Level[ 2*N ];
LL Time = 0;
LL BIT[ 2*N ];

vector <int> graph[ 2*N ];

void dfs( int s , int p ) {
    Start[s] = ++Time;
    Level[s] = Level[p]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ){
        int next = graph[ s ][ i ];
        if( next == p ) continue;
        dfs( next , s );
    }
    Finish[ s ] = Time;
}
void Update( LL idx , LL val ) {
    for( ; idx <= 2*N; idx += ( idx & -idx ) ) {
        BIT[idx] += val;
    }
}
LL Query( LL idx ) {
    LL ret = 0;
    for( ; idx > 0 ; idx -= ( idx & -idx ) ) {
        ret += BIT[idx];
    }
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%lld %lld",&n,&m);
    for( int i = 1; i <= n; i++ ) {
        scanf("%lld", &ara[i]);
    }
    for( int i = 1; i <= n-1; i++ ) {
        int u , v;
        scanf("%d %d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    Time = 0;
    dfs( 1 , 0 );
    while( m-- ) {
        int op;
        scanf("%d",&op);
        if( op == 1 ) {
            int pos , val;
            scanf("%d %d",&pos,&val);
            int from = Start[pos] , to = Finish[pos];
            if( Level[pos]&1 ) {
                Update( from , +val );
                Update( to+1 , -val );
            }
            else {
                Update( from , -val );
                Update( to+1 , +val );
            }
        }
        else {
            int pos;
            scanf("%d",&pos);
            int x = Start[pos];
            LL ans = Query( x );
            if( Level[pos]&1 ) printf("%lld\n",ara[pos]+ans);
            else printf("%lld\n",ara[pos]-ans);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s , int par) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    Level[ s ] = Level[ par ]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            dfs( next , s );
        }
    }
    Finish[ s ] = ++Time;
}
void Update( int idx , int val ) {
    while( idx <= N ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 , 0 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 0 ) {
                Update( Start[ node ] , +val );
                Update( Finish[ node ]+1 , -val );
            }
            else {
               Update( Start[ node ] , -val );
               Update( Finish[ node ]+1 , +val );
            }
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 0 ) printf("%d\n",ara[ node ]+res);
            else printf("%d\n",ara[ node ]-res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

LL n , m;
LL ara[ 2*N ];
LL Start[ 2*N ] , Finish[ 2*N ] , Level[ 2*N ];
LL Time = 0;
LL BIT[ 2*N ];

vector <int> graph[ 2*N ];

void dfs( int s , int p ) {
    Start[s] = ++Time;
    Level[s] = Level[p]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ){
        int next = graph[ s ][ i ];
        if( next == p ) continue;
        dfs( next , s );
    }
    Finish[ s ] = Time;
}
void Update( LL idx , LL val ) {
    for( ; idx <= 2*N; idx += ( idx & -idx ) ) {
        BIT[idx] += val;
    }
}
LL Query( LL idx ) {
    LL ret = 0;
    for( ; idx > 0 ; idx -= ( idx & -idx ) ) {
        ret += BIT[idx];
    }
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%lld %lld",&n,&m);
    for( int i = 1; i <= n; i++ ) {
        scanf("%lld", &ara[i]);
    }
    for( int i = 1; i <= n-1; i++ ) {
        int u , v;
        scanf("%d %d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    Time = 0;
    dfs( 1 , 0 );
    while( m-- ) {
        int op;
        scanf("%d",&op);
        if( op == 1 ) {
            int pos , val;
            scanf("%d %d",&pos,&val);
            int from = Start[pos] , to = Finish[pos];
            if( Level[pos]&1 ) {
                Update( from , +val );
                Update( to+1 , -val );
            }
            else {
                Update( from , -val );
                Update( to , +val );
            }
        }
        else {
            int pos;
            scanf("%d",&pos);
            int x = Start[pos];
            LL ans = Query( x );
            if( Level[pos]&1 ) printf("%lld\n",ara[pos]+ans);
            else printf("%lld\n",ara[pos]-ans);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s ) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            Level[ next ] = Level[ s ]+1;
            dfs( next );
        }
    }
    Finish[ s ] = ++Time;
}
void Update( int idx , int val ) {
    while( idx <= Time ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 1 ) val = -val;
            Update( Start[ node ] , +val );
            Update( Finish[ node ] , -val );
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 1 ) res = -res;
            printf("%d\n",ara[ node ]+res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s ) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            Level[ next ] = Level[ s ]+1;
            dfs( next );
        }
    }
    Finish[ s ] = ++Time;
}
void Update( int idx , int val ) {
    while( idx <= N ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 1 ) val = -val;
            Update( Start[ node ] , +val );
            Update( Finish[ node ]+1 , -val );
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 1 ) res = -res;
            printf("%d\n",ara[ node ]+res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s , int par) {
    Start[ s ] = ++Time;
    Level[ s ] = Level[ par ]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( next != par ) {
            dfs( next , s );
        }
    }
    Finish[ s ] = Time;
}
void Update( int idx , int val ) {
    while( idx <= N ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 , 0 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 0 ) {
                Update( Start[ node ] , +val );
                Update( Finish[ node ]+1 , -val );
            }
            else {
               Update( Start[ node ] , -val );
               Update( Finish[ node ]+1 , +val );
            }
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 0 ) printf("%d\n",ara[ node ]+res);
            else printf("%d\n",ara[ node ]-res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s ) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            Level[ next ] = Level[ s ]+1;
            dfs( next );
        }
    }
    Finish[ s ] = ++Time;
}
void Update( int idx , int val ) {
    while( idx <= N ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 0 ) val = -val;
            Update( Start[ node ] , +val );
            Update( Finish[ node ]+1 , -val );
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 0 ) res = -res;
            printf("%d\n",ara[ node ]+res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

LL n , m;
LL ara[ 2*N ];
LL Start[ 2*N ] , Finish[ 2*N ] , Level[ 2*N ];
LL Time = 0;
LL Tree[ 2*4*N ] , Lazy[ 2*4*N ];

vector <int> graph[ 2*N ];

void Propagate( LL node , LL b , LL e ) {
    if( Lazy[node] != 0 ) {
        Tree[node] += ( Lazy[node] );
        if( b != e ) {
            Lazy[2*node] += Lazy[node];
            Lazy[2*node+1] += Lazy[node];
        }
        Lazy[node] = 0;
    }
}
void Update( LL node , LL b , LL e , LL i , LL j , LL val ) {
    Propagate( node , b , e );
    if( i > e || j < b ) return;
    if( i <= b && j >= e ) {
        Tree[node] += val;
        if( b != e ) {
            Lazy[2*node] += val;
            Lazy[2*node+1] += val;
        }
        return;
    }
    LL left = 2*node , right = 2*node+1 , mid = (b+e)/2;
    Update( left , b , mid , i , j , val );
    Update( right , mid+1 , e , i , j , val );
    Tree[node] = Tree[left] + Tree[right];
}
LL Query( LL node , LL b , LL e , LL pos ) {
    Propagate( node , b , e );
    if( pos > e || pos < b ) return 0LL;
    if( b == e && b == pos ) return Tree[node];
    LL left = 2*node , right = 2*node+1 , mid = (b+e)/2;
    LL q1 = Query( left , b , mid , pos );
    LL q2 = Query( right , mid+1 , e , pos );
    return ( q1+q2 );
}
void dfs( int s , int p ) {
    Start[s] = ++Time;
    Level[s] = Level[p]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ){
        int next = graph[ s ][ i ];
        if( next == p ) continue;
        dfs( next , s );
    }
    Finish[ s ] = Time;
}
int main( int argc, char const *argv[] ) {
    scanf("%lld %lld",&n,&m);
    for( int i = 1; i <= n; i++ ) {
        scanf("%lld", &ara[i]);
    }
    for( int i = 1; i <= n-1; i++ ) {
        int u , v;
        scanf("%d %d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 , 0 );
    while( m-- ) {
        int op;
        scanf("%d",&op);
        if( op == 1 ) {
            int pos , val;
            scanf("%d %d",&pos,&val);
            int from = Start[pos] , to = Finish[pos];
            if( Level[pos]&1 ) Update( 1 , 1 , n , from , to , +val );
            else Update( 1 , 1 , n , from , to , -val );
        }
        else {
            int pos;
            scanf("%d",&pos);
            int x = Start[pos];
            LL ans = Query( 1 , 1 , n , x );
            if( Level[pos]&1 ) printf("%lld\n",ara[pos]+ans);
            else printf("%lld\n",ara[pos]-ans);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s , int par) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    Level[ s ] = Level[ par ]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            dfs( next , s );
        }
    }
    Finish[ s ] = Time;
}
void Update( int idx , int val ) {
    while( idx <= N ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 , 0 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 0 ) {
                Update( Start[ node ] , +val );
                Update( Finish[ node ]+1 , -val );
            }
            else {
               Update( Start[ node ] , -val );
               Update( Finish[ node ]+1 , +val );
            }
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 0 ) printf("%d\n",ara[ node ]+res);
            else printf("%d\n",ara[ node ]-res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

LL n , m;
LL ara[ 2*N ];
LL Start[ 2*N ] , Finish[ 2*N ] , Level[ 2*N ];
LL Time = 0;
LL Tree[ 2*4*N ] , Lazy[ 2*4*N ];

vector <int> graph[ 2*N ];

void Propagate( LL node , LL b , LL e ) {
    if( Lazy[node] != 0 ) {
        Tree[node] += ( Lazy[node] );
        if( b != e ) {
            Lazy[2*node] += Lazy[node];
            Lazy[2*node+1] += Lazy[node];
        }
        Lazy[node] = 0;
    }
}
void Update( LL node , LL b , LL e , LL i , LL j , LL val ) {
    Propagate( node , b , e );
    if( i > e || j < b ) return;
    if( i <= b && j >= e ) {
        Tree[node] += val;
        if( b != e ) {
            Lazy[2*node] += val;
            Lazy[2*node+1] += val;
        }
        return;
    }
    LL left = 2*node , right = 2*node+1 , mid = (b+e)/2;
    Update( left , b , mid , i , j , val );
    Update( right , mid+1 , e , i , j , val );
    Tree[node] = Tree[left] + Tree[right];
}
LL Query( LL node , LL b , LL e , LL pos ) {
    Propagate( node , b , e );
    if( pos > e || pos < b ) return 0LL;
    if( b == e && b == pos ) return Tree[node];
    LL left = 2*node , right = 2*node+1 , mid = (b+e)/2;
    LL q1 = Query( left , b , mid , pos );
    LL q2 = Query( right , mid+1 , e , pos );
    return ( q1+q2 );
}
void dfs( int s , int p ) {
    Start[s] = ++Time;
    Level[s] = Level[p]+1;
    for( int i = 0; i < graph[ s ].size(); i++ ){
        int next = graph[ s ][ i ];
        if( next == p ) continue;
        dfs( next , s );
    }
    Finish[ s ] = Time;
}
int main( int argc, char const *argv[] ) {
    scanf("%lld %lld",&n,&m);
    for( int i = 1; i <= n; i++ ) {
        scanf("%lld", &ara[i]);
    }
    for( int i = 1; i <= n-1; i++ ) {
        int u , v;
        scanf("%d %d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    Time = 0;
    dfs( 1 , 0 );
    while( m-- ) {
        int op;
        scanf("%d",&op);
        if( op == 1 ) {
            int pos , val;
            scanf("%d %d",&pos,&val);
            int from = Start[pos] , to = Finish[pos];
            if( Level[pos]&1 ) Update( 1 , 1 , n , from , to , +val );
            else Update( 1 , 1 , n , from , to , -val );
        }
        else {
            int pos;
            scanf("%d",&pos);
            int x = Start[pos];
            LL ans = Query( 1 , 1 , n , x );
            if( Level[pos]&1 ) printf("%lld\n",ara[pos]+ans);
            else printf("%lld\n",ara[pos]-ans);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s ) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            Level[ next ] = Level[ s ]+1;
            dfs( next );
        }
    }
    Finish[ s ] = ++Time;
}
void Update( int idx , int val ) {
    while( idx <= N ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 0 ) {
                Update( Start[ node ] , +val );
                Update( Finish[ node ]+1 , -val );
            }
            else {
               Update( Start[ node ] , -val );
               Update( Finish[ node ]+1 , +val );
            }
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 0 ) printf("%d\n",ara[ node ]+res);
            else printf("%d\n",ara[ node ]-res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 200005;
int ara[ N ];
vector < int > graph[ N ];
bool visited[ N ];
int Start[ N ], Finish[ N ], Level[ N ];
int Time = 0;
int BIT[ N ];

void dfs( int s ) {
    visited[ s ] = true;
    Start[ s ] = ++Time;
    for( int i = 0; i < graph[ s ].size(); i++ ) {
        int next = graph[ s ][ i ];
        if( !visited[ next ] ) {
            Level[ next ] = Level[ s ]+1;
            dfs( next );
        }
    }
    Finish[ s ] = ++Time;
}
void Update( int idx , int val ) {
    while( idx <= Time ) {
        BIT[ idx ] += val;
        idx += ( idx & -idx );
    }
}
int Query( int idx ) {
    int sum = 0;
    while( idx > 0 ) {
        sum += BIT[ idx ];
        idx -= ( idx & -idx );
    }
    return sum;
}
int main( int argc, char const *argv[] ) {
    int n, q;
    scanf("%d%d",&n,&q);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    for( int i = 1; i<= n-1; i++ ) {
        int u, v;
        scanf("%d%d",&u,&v);
        graph[ u ].push_back( v );
        graph[ v ].push_back( u );
    }
    dfs( 1 );
    for( int k = 1; k <= q; k++ ) {
        int op;
        scanf("%d",&op);
        if(op == 1) {
            int node, val;
            scanf("%d%d",&node,&val);
            if( Level[ node ]%2 == 1 ) val = -val;
            Update( Start[ node ] , +val );
            Update( Finish[ node ]+1 , -val );
        }
        else {
            int node;
            scanf("%d",&node);
            int res = Query( Start[ node ] );
            if( Level[ node ]%2 == 1 ) res = -res;
            printf("%d\n",ara[ node ]+res);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

struct range {
    int el,ol,er,orr;
} rg[200010];

vector<int> adj[200010];

int arr[200010];
int lvl[200010];
int even[4*200010],odd[4*100010],elazy[4*200010],olazy[4*200010];
int ogl,egl;

void explore(int root,int p,int level) {
    lvl[root] = level;
    if(level&1) {
        rg[root].ol = ogl++;
        rg[root].el = egl;
        for(int &x: adj[root]) if(x != p)
            explore(x,root,level+1);
        rg[root].orr = ogl-1;
        rg[root].er = egl-1;
    } else {
        rg[root].ol = ogl;
        rg[root].el = egl++;
        for(int &x: adj[root]) if(x != p)
            explore(x,root,level+1);
        rg[root].orr = ogl-1;
        rg[root].er = egl-1;
    }
}

void push_lazy(int* tree,int* lazy,int root) {
    if(lazy[root] != 0) {
        tree[root] += lazy[root];
        lazy[root*2+1] += lazy[root];
        lazy[root*2+2] += lazy[root];
        lazy[root] = 0;
    }

}

int query_tree(int* tree,int* lazy,int root,int b,int e,int l,int r) {
    //cout << b << " " << e << " " << tree[root]  << " " << lazy[root] << endl;

    if(b != e)
        push_lazy(tree,lazy,root);
    else {
        tree[root] += lazy[root]; lazy[root] = 0;
    }
    if(r < b || l > e)
        return 0;

    if(l <= b && e <= r)
        return tree[root];

    int mid = (b+e)/2, lc=root*2+1,rc=root*2+2;

    return query_tree(tree,lazy,lc,b,mid,l,r)
        + query_tree(tree,lazy,rc,mid+1,e,l,r);
}

void update_tree(int* tree,int* lazy,int root,int b,int e,int l,int r,int val) {
    //cout << b << " " << e << " " << l << " " << r << " " << tree[root]  << " " << lazy[root] << endl;

    if(b != e)
        push_lazy(tree,lazy,root);
    else {
        tree[root] += lazy[root]; lazy[root] = 0;
    }
    if(r < b || l > e)
        return;
    if(l <= b && e <= r) {
        lazy[root] += val;
        return;
    }
    int mid = (b+e)/2, lc=root*2+1,rc=root*2+2;
    update_tree(tree,lazy,lc,b,mid,l,r,val);
    update_tree(tree,lazy,rc,mid+1,e,l,r,val);
}

void update(int xx,int val) {
    //cout << xx << endl;
    int oddval = val,evenval = val;
    if(lvl[xx]&1)
        evenval = -val;
    else
        oddval = -val;
    if(rg[xx].el <= rg[xx].er) {
        //cout << rg[xx].el << " " << rg[xx].er << endl;
        update_tree(even,elazy,0,0,egl-1,rg[xx].el,rg[xx].er,evenval);
    }
    //cout << endl;
    if(rg[xx].ol <= rg[xx].orr) {
        //cout << rg[xx].ol << " " << rg[xx].orr << endl;
        update_tree(odd,olazy,0,0,ogl-1,rg[xx].ol,rg[xx].orr,oddval);

    }
}

int query(int node) {
    if(lvl[node]&1) {
        return query_tree(odd,olazy,0,0,ogl-1,rg[node].ol,rg[node].ol);
    }
    else
        return query_tree(even,elazy,0,0,egl-1,rg[node].el,rg[node].el
        );
}

int main() {
    std::ios::sync_with_stdio(false);
    int n,m;
    int v,u;
    cin >> n >> m;

    for(int i = 1;i <= n; i ++) {
        cin >> arr[i];
    }
    for(int i = 0; i < n-1;i ++) {
        cin >> v >> u;
        adj[v].push_back(u);
        adj[u].push_back(v);
    }
    explore(1,-1,0);

   // for(int i = 1; i <= n; i ++) {
     //   cout << rg[i].ol << " " << rg[i].orr << " " << rg[i].el << " " << rg[i].er << endl;
   // }

    int x,val;
    for(int i = 0; i < m; i ++) {
        cin >> x >> v;
        if(x == 1) {
            cin >> val;
            update(v,val);
        } else {
            cout << arr[v] + query(v) << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

struct range {
    int el,ol,er,orr;
} rg[200010];

vector<int> adj[200010];

int arr[200010];
int lvl[200010];
int even[4*200010],odd[4*100010],elazy[4*200010],olazy[4*200010];
int ogl,egl;

void explore(int root,int p,int level) {
    lvl[root] = level;
    if(level&1) {
        rg[root].ol = ogl++;
        rg[root].el = egl;
        for(int &x: adj[root]) if(x != p)
            explore(x,root,level+1);
        rg[root].orr = ogl-1;
        rg[root].er = egl-1;
    } else {
        rg[root].ol = ogl;
        rg[root].el = egl++;
        for(int &x: adj[root]) if(x != p)
            explore(x,root,level+1);
        rg[root].orr = ogl-1;
        rg[root].er = egl-1;
    }
}

void push_lazy(int* tree,int* lazy,int root) {
    if(lazy[root] != 0) {
        tree[root] += lazy[root];
        lazy[root*2+1] += lazy[root];
        lazy[root*2+2] += lazy[root];
        lazy[root] = 0;
    }

}

int query_tree(int* tree,int* lazy,int root,int b,int e,int l,int r) {
    //cout << b << " " << e << " " << tree[root]  << " " << lazy[root] << endl;

    if(b != e)
        push_lazy(tree,lazy,root);
    else {
        tree[root] += lazy[root]; lazy[root] = 0;
    }
    if(r < b || l > e)
        return 0;

    if(l <= b && e <= r)
        return tree[root];

    int mid = (b+e)/2, lc=root*2+1,rc=root*2+2;

    return query_tree(tree,lazy,lc,b,mid,l,r)
        + query_tree(tree,lazy,rc,mid+1,e,l,r);
}

void update_tree(int* tree,int* lazy,int root,int b,int e,int l,int r,int val) {
    //cout << b << " " << e << " " << l << " " << r << " " << tree[root]  << " " << lazy[root] << endl;

    if(b != e)
        push_lazy(tree,lazy,root);
    else {
        tree[root] += lazy[root]; lazy[root] = 0;
    }
    if(r < b || l > e)
        return;
    if(l <= b && e <= r) {
        lazy[root] += val;
        return;
    }
    int mid = (b+e)/2, lc=root*2+1,rc=root*2+2;
    update_tree(tree,lazy,lc,b,mid,l,r,val);
    update_tree(tree,lazy,rc,mid+1,e,l,r,val);
}

void update(int xx,int val) {
    //cout << xx << endl;
    int oddval = val,evenval = val;
    if(lvl[xx]&1)
        evenval = -val;
    else
        oddval = -val;
    if(rg[xx].el <= rg[xx].er) {
        //cout << rg[xx].el << " " << rg[xx].er << endl;
        update_tree(even,elazy,0,0,egl-1,rg[xx].el,rg[xx].er,evenval);
    }
    //cout << endl;
    if(rg[xx].ol <= rg[xx].orr) {
        //cout << rg[xx].ol << " " << rg[xx].orr << endl;
        update_tree(odd,olazy,0,0,ogl-1,rg[xx].ol,rg[xx].orr,oddval);

    }
}

int query(int node) {
    if(lvl[node]&1) {
        return query_tree(odd,olazy,0,0,ogl-1,rg[node].ol,rg[node].ol);
    }
    else
        return query_tree(even,elazy,0,0,egl-1,rg[node].el,rg[node].el
        );
}

int main() {
    int n,m;
    int v,u;
    cin >> n >> m;

    for(int i = 1;i <= n; i ++) {
        cin >> arr[i];
    }
    for(int i = 0; i < n-1;i ++) {
        cin >> v >> u;
        adj[v].push_back(u);
        adj[u].push_back(v);
    }
    explore(1,-1,0);

   // for(int i = 1; i <= n; i ++) {
     //   cout << rg[i].ol << " " << rg[i].orr << " " << rg[i].el << " " << rg[i].er << endl;
   // }

    int x,val;
    for(int i = 0; i < m; i ++) {
        cin >> x >> v;
        if(x == 1) {
            cin >> val;
            update(v,val);
        } else {
            cout << arr[v] + query(v) << endl;
        }
    }
    return 0;
}


#include <map>
#include <unordered_map>
#include <set>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>
#define PI acos(-1.0)
#define INF 100000000
#define llINF 923372036854775807
#define EPS 1e-9
#define sz(v)        static_cast<int>((v).size())
#define pb(...)      push_back(__VA_ARGS__)
#define mp(x, y)     make_pair((x), (y))
#define clr(x) memset(x, 0, sizeof(x))
#define clr1(x) memset(x, INF, sizeof(x))
#define dREP(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define DFS_WHITE -1
#define DFS_BLACK 1
#define DFS_GRAY 2
#define NOT(x)  (1^(x))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> Graph;
typedef map<int, int>::iterator it_type;
typedef vector<int> row;
typedef vector<row> matrix;
int MOD  = 1000000007;
inline int toInt(string s){int v; istringstream sin(s);sin>>v;return v;}
inline ll toll(string s){ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}
#define rep(i, v) for(int i=0;i<sz(v);++i)
#define MAX 200005
#define LSOne(S) (S & (-S))

class FenwickTree {
private:
    vi ft;
public:
    FenwickTree() {}
    FenwickTree(int n) { ft.assign(n + 1, 0); }
    int rsq(int b) {
        int sum = 0; for (; b; b -= LSOne(b)) sum += ft[b];
        return sum; }

    int rsq(int a, int b) {
        return rsq(b) - (a == 1 ? 0 : rsq(a - 1)); }

    void adjust(int k, int v) {
        for (; k < (int)ft.size(); k += LSOne(k)) ft[k] += v;
    }
    void adjustRange(int v,int l,int r){
        adjust(l , v);
        if(r + 1 < ft.size())
            adjust(r + 1 , -v);
    }
};

Graph g;
FenwickTree ft(MAX*2);
int tin[MAX],tout[MAX];
int value[MAX];
bool isOdd[MAX];
int cnt = 1;
void dfs(int u,int p = -1,int parity = 0){
    isOdd[u] = parity;
    tin[u] = cnt++;
    for (int v: g[u]) {
        if (v != p) {
            dfs(v,u,parity^1);
        }
    }
    tout[u] = cnt++;
}

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("grant.in" , "r", stdin);
    //freopen("grant.out" , "w", stdout);
    int n,m;
    cin>>n>>m;
    g.assign(n, vi());
    for (int i = 0; i < n; i++) {
        cin>>value[i];
    }
    for (int i = 0; i < n-1 ; i++) {
        int u,v;
        cin>>u>>v;
        u--,v--;
        g[u].pb(v);
        g[v].pb(u);
    }
    dfs(0);
    while (m--) {
        int c,x,val;
        cin>>c>>x;
        x--;
        if (c == 1) {
            cin>>val;
            if (isOdd[x]) {
                ft.adjustRange(-val, tin[x], tout[x] + 1);
            }else{
                ft.adjustRange(val, tin[x], tout[x] + 1);
            }
        }else{
            if (isOdd[x]) {
                cout<<value[x] - ft.rsq(tin[x])<<endl;
            }else{
                cout<<value[x] + ft.rsq(tin[x])<<endl;
            }
        }
    }
    return 0;
}


#include <map>
#include <unordered_map>
#include <set>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>
#define PI acos(-1.0)
#define INF 100000000
#define llINF 923372036854775807
#define EPS 1e-9
#define sz(v)        static_cast<int>((v).size())
#define pb(...)      push_back(__VA_ARGS__)
#define mp(x, y)     make_pair((x), (y))
#define clr(x) memset(x, 0, sizeof(x))
#define clr1(x) memset(x, INF, sizeof(x))
#define dREP(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define DFS_WHITE -1
#define DFS_BLACK 1
#define DFS_GRAY 2
#define NOT(x)  (1^(x))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> Graph;
typedef map<int, int>::iterator it_type;
typedef vector<int> row;
typedef vector<row> matrix;
int MOD  = 1000000007;
inline int toInt(string s){int v; istringstream sin(s);sin>>v;return v;}
inline ll toll(string s){ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}
#define rep(i, v) for(int i=0;i<sz(v);++i)
#define MAX 200005
#define LSOne(S) (S & (-S))

class FenwickTree {
private:
    vi ft;
public:
    FenwickTree() {}
    FenwickTree(int n) { ft.assign(n + 1, 0); }
    int rsq(int b) {
        int sum = 0; for (; b; b -= LSOne(b)) sum += ft[b];
        return sum; }

    int rsq(int a, int b) {
        return rsq(b) - (a == 1 ? 0 : rsq(a - 1)); }

    void adjust(int k, int v) {
        for (; k < (int)ft.size(); k += LSOne(k)) ft[k] += v;
    }
    void adjustRange(int v,int l,int r){
        adjust(l , v);
        if(r + 1 < ft.size())
            adjust(r + 1 , -v);
    }
};
Graph g;
FenwickTree ft(MAX*2);
int tin[MAX],tout[MAX];
int value[MAX];
bool isOdd[MAX];
int cnt = 1;
void dfs(int u,int p = -1,int parity = 0){
    isOdd[u] = parity;
    tin[u] = cnt++;
    for (int v: g[u]) {
        if (v != p) {
            dfs(v,u,parity^1);
        }
    }
    tout[u] = cnt++;
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("grant.in" , "r", stdin);
    //freopen("grant.out" , "w", stdout);
    int n,m;
    cin>>n>>m;
    g.assign(n, vi());
    for (int i = 0; i < n; i++) {
        cin>>value[i];
    }
    for (int i = 0; i < n-1 ; i++) {
        int u,v;
        cin>>u>>v;
        u--,v--;
        g[u].pb(v);
        g[v].pb(u);
    }
    dfs(0);
    while (m--) {
        int c,x,val;
        cin>>c>>x;
        x--;
        if (c == 1) {
            cin>>val;
            if (isOdd[x]) {
                ft.adjustRange(-val, tin[x], tout[x]);
            }else{
                ft.adjustRange(val, tin[x], tout[x]);
            }
        }else{
            if (isOdd[x]) {
                cout<<value[x] - ft.rsq(tin[x])<<endl;
            }else{
                cout<<value[x] + ft.rsq(tin[x])<<endl;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
#define ll long long
#define pb push_back
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
//typedef long long  MOD=1000000009;
ll MOD=998244353;
ll add(ll x, ll y) {ll res = x + y; return (res >= MOD ? res - MOD : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= MOD ? res % MOD : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + MOD : res);}
ll lcm(ll x, ll y) {ll res = (x * y) / __gcd(x, y); return res;}
ll power(ll x, ll y) {if (y < 0) return 1; ll res = 1; x %= MOD; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}

void iofoj(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
bool visi[200005];
vector<ll>v[200005];
ll N=200005;
ll value[200005],subtree[200005];
ll parity[200005];
ll level[200005];

// ll ans;
// // ll n,m,k,w;
// // ll siz[300005],par[300005];
// ll maxi;
vector<ll>dfs_array;
void dfs(ll u)
{
    visi[u]=true;
    dfs_array.pb(u);
    for(auto i:v[u])
    {
        if(visi[i]==false)
        {
            level[i]=level[u]+1;
            dfs(i);
            subtree[u]+=subtree[i];
        }
    }
}

ll BIT[2][200005];

void update(ll i,ll val,ll j)
{
    i++;
    while(i<200005)
    {
        BIT[j][i]+=val;
        i+=i&(-i);
    }
}

ll sum(ll i,ll j)
{
    ll ans=0;
    i++;
    while(i>0)
    {
        ans+=BIT[j][i];
        i-=i&(-i);
    }
    return ans;
}

void solution()
{
    ll k,i,j,h,d,n,m;
    cin>>n>>m;
    for(i=0;i<n;i++)
    cin>>value[i],visi[i]=false,subtree[i]=1;
    k=n-1;
    while(k--)
    {
        cin>>i>>j;
        i--;
        j--;
        v[i].pb(j);
        v[j].pb(i);
    }
    dfs(0);
    memset(BIT,0,sizeof(BIT));
    ll position[n+1];
    for(i=0;i<n;i++)
    {
        position[dfs_array[i]]=i;
        parity[i]=level[i]%2;
    }
    while(m--)
    {
        ll x;
        cin>>i>>x;
        x--;
        if(i==1)
        {
            ll val;
            cin>>val;
            update(position[x],val,parity[x]);
            update(position[x]+subtree[x],-val,parity[x]);
            update(position[x],-val,1-parity[x]);
            update(position[x]+subtree[x],val,1-parity[x]);
        }
        else
        {
            ll ans=value[x]+sum(position[x],parity[x]);
            cout<<ans<<"\n";
        }
    }
    // for(i=0;i<n;i++)
    // cout<<position[i]<<" ";
}

int main(){
    fio
    //iofoj();
    // ll t;
    // cin>>t;
    // while(t--)
    solution();
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
#define ll long long
#define pb push_back
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
//typedef long long  MOD=1000000009;
ll MOD=998244353;
ll add(ll x, ll y) {ll res = x + y; return (res >= MOD ? res - MOD : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= MOD ? res % MOD : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + MOD : res);}
ll lcm(ll x, ll y) {ll res = (x * y) / __gcd(x, y); return res;}
ll power(ll x, ll y) {if (y < 0) return 1; ll res = 1; x %= MOD; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}

void iofoj(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
bool visi[200005];
vector<ll>v[200005];
ll N=200005;
ll value[100005],subtree[100005];
ll parity[200005];
ll level[200005];

// ll ans;
// // ll n,m,k,w;
// // ll siz[300005],par[300005];
// ll maxi;
vector<ll>dfs_array;
void dfs(ll u)
{
    visi[u]=true;
    dfs_array.pb(u);
    for(auto i:v[u])
    {
        if(visi[i]==false)
        {
            level[i]=level[u]+1;
            dfs(i);
            subtree[u]+=subtree[i];
        }
    }
}

ll BIT[2][200005];
ll last[600000];
ll ans[500008];

void update(ll i,ll val,ll j)
{
    i++;
    while(i<200005)
    {
        BIT[j][i]+=val;
        i+=i&(-i);
    }
}

ll sum(ll i,ll j)
{
    ll ans=0;
    i++;
    while(i>0)
    {
        ans+=BIT[j][i];
        i-=i&(-i);
    }
    return ans;
}

void solution()
{
    ll k,i,j,h,d,n,m;
    cin>>n>>m;
    for(i=0;i<n;i++)
    cin>>value[i],visi[i]=false,subtree[i]=1;
    k=n-1;
    while(k--)
    {
        cin>>i>>j;
        i--;
        j--;
        v[i].pb(j);
        v[j].pb(i);
    }
    dfs(0);
    memset(BIT,0,sizeof(BIT));
    ll position[n+1];
    for(i=0;i<n;i++)
    {
        position[dfs_array[i]]=i;
        parity[i]=level[i]%2;
    }
    while(m--)
    {
        ll x;
        cin>>i>>x;
        x--;
        if(i==1)
        {
            ll val;
            cin>>val;
            update(position[x],val,parity[x]);
            update(position[x]+subtree[x],-val,parity[x]);
            update(position[x],-val,1-parity[x]);
            update(position[x]+subtree[x],val,1-parity[x]);
        }
        else
        {
            ll ans=value[x]+sum(position[x],parity[x]);
            cout<<ans<<"\n";
        }
    }
    // for(i=0;i<n;i++)
    // cout<<position[i]<<" ";
}

int main(){
    fio
    //iofoj();
    // ll t;
    // cin>>t;
    // while(t--)
    solution();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define SZ 100005
#define boost ios::sync_with_stdio(0);

int bit[400005],n,m,t,st[200005],en[200005],sgn[200005];
vec<int> adj[200005];

void update(int x,int val){
	for(int i=x; i<=2*n; i+=i&(-i))
	bit[i]+=val;
}
int query(int x){
	int sum=0;
	for(int i=x; i>0; i-=i&(-i))
	sum+=bit[i];
	return sum;
}

void dfs(int u,int p,int s){
	t++;
	st[u]=t;
	sgn[u]=s;
	for (int i: adj[u])
	    if(i-p)
		dfs(i,u,-s);
	en[u]=t;
}
int main()
{
	boost;
	int x,val,u,v,typ;
	cin>>n>>m;
	int a[n+1];
	for(int i=1; i<=n; i++) cin>>a[i];
	for(int i=0; i<n-1; i++){
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,-1,1);

	while (m--)
	{
		cin>>typ;
		if (typ==1){
			cin>>x>>val;
			update(st[x],val*sgn[x]);
			update(en[x]+1,-val*sgn[x]);
		}
		else{
			cin>>x;
			cout<<a[x]+query(st[x])*sgn[x]<<endl;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define SZ 100005
#define boost ios::sync_with_stdio(0);

int bit[400005],n,m,t,st[200005],en[200005],sgn[200005];
vec<int> adj[200005];

void update(int x,int val){
	for(int i=x; i<=2*n; i+=i&(-i))
	bit[i]+=val;
}
int query(int x){
	int sum=0;
	for(int i=x; i>0; i-=i&(-i))
	sum+=bit[i];
	return sum;
}

void dfs(int u,int p,int s){
	st[u]=++t;
	sgn[u]=s;
	for (int i: adj[u])
	    if(i-p)
		dfs(i,u,-s);
	en[u]=++t;
}
int main()
{
	boost;
	int x,val,u,v,typ;
	cin>>n>>m;
	int a[n+1];
	for(int i=1; i<=n; i++) cin>>a[i];
	for(int i=0; i<n-1; i++){
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,-1,1);

	while (m--)
	{
		cin>>typ;
		if (typ==1){
			cin>>x>>val;
			update(st[x],val*sgn[x]);
			update(en[x]+1,-val*sgn[x]);
		}
		else{
			cin>>x;
			cout<<a[x]+query(st[x])*sgn[x]<<endl;
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

#define io_speedup ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define f(i,a,b) for(i=a;i<=b;++i)
#define rf(i,a,b) for(i=a;i>=b;--i)
#define mem(a,n) memset(a,n,sizeof(a))
#define copy(a,b) memcpy(a,b,sizeof(b))
#define endl '\n'
#define cp complex
const int INF=~(1<<31);

const double E=exp(1.0);
const double Pi=4*atan(1.0);
int solve(int);

int main()
{
    io_speedup
    int T,i;
    T=1;
    f(i,1,T){
        int x=solve(i);
    }
	return 0;
}

int n,m;
const int N=2e5+5;
const int md=1e9+7;
vector<int>a[N];
int L[N],R[N],level[N],num[N],rnum[N],v[N];
int cnt=0;

int dfs(int x,int pre,int lv){
    int m=a[x].size(),i;
    num[x]=++cnt;rnum[cnt]=x;
    L[cnt]=R[cnt]=cnt;
    level[cnt]=lv;
    f(i,0,m-1){
        if(a[x][i]==pre)continue;
        R[num[x]]=dfs(a[x][i],x,lv+1);
    }
    return num[x];
}

struct Tree{
    int v,flag[2];	//flag为lazy操作
    void z(){flag[0]=flag[1]=0;}
}tree[4*N];

void build(int n,int l, int r){	//减数
    if(l==r){
        tree[n].v=v[rnum[l]];
        tree[n].z();
        return;
    }
    int mid=(l+r)>>1,n1=n<<1,n2=(n<<1)+1;
    build(n1,l,mid);
    build(n2,mid+1,r);
}

int to(int*a,int x){
    int lv=level[x];
    return lv&1?a[1]-a[0]:a[0]-a[1];
}
int down(int a,int b){
    tree[b].flag[0]+=tree[a].flag[0];
    tree[b].flag[1]+=tree[a].flag[1];
}
int _search(int n, int l ,int r, int x){		//点查询
    if(l==r){
        tree[n].v+=to(tree[n].flag,l);
        tree[n].z();
        return tree[n].v;
    }
    int mid=(l+r)>>1;
    int n1=n<<1,n2=(n<<1)|1;
    down(n,n1);down(n,n2);
    tree[n].z();
    if(x<=mid)
       return  _search(n1,l,mid,x);
    else
       return _search(n2,mid+1,r,x);
}

void update(int n, int l, int r,int x, int y,int val,int k){		//区域更新
    if(x<=l&&y>=r){
            tree[n].flag[k]+=val;
            return;
    }
    int mid=(l+r)>>1;int n1=n<<1,n2=(n<<1)|1;
    if(x<=mid)
        update(n1,l,mid,x,y,val,k);
    if(y>mid)
        update(n2,mid+1,r,x,y,val,k);
}

void print_tree(int n){
    int i,j;
    int num=0;
    for(i=0;int(pow(2,i-1))<=n;++i){
        f(j,1,int(pow(2,i)))
            printf("(%d,%d) ",tree[++num].flag[0],tree[num].flag[1]);
        cout<<endl;
    }
    cout<<endl;
}

int solve(int T){
    int i,j;
    cin>>n>>m;
    f(i,1,n)cin>>v[i];
    f(i,1,n-1){
        int x,y;
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int root=1;
    dfs(root,-1,1);
    build(1,1,n);
//    cout<<endl;
//    f(i,1,n)cout<<L[i]<<' '<<R[i]<<endl;;cout<<endl;
    f(i,1,m){
        int flag,x,val;
       // print_tree(n);
        cin>>flag;
        if(flag==1){
            cin>>x>>val;
            int p=num[x];
            int k=level[p]%2;
            update(1,1,n,L[p],R[p],val,k);
        }
        else{
            cin>>x;
            cout<<_search(1,1,n,num[x])<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define io_speedup ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define f(i,a,b) for(i=a;i<=b;++i)
#define rf(i,a,b) for(i=a;i>=b;--i)
#define mem(a,n) memset(a,n,sizeof(a))
#define copy(a,b) memcpy(a,b,sizeof(b))
#define endl '\n'
#define cp complex
const int INF=~(1<<31);

const double E=exp(1.0);
const double Pi=4*atan(1.0);
int solve(int);

int main()
{
    io_speedup
    int T,i;
    T=1;
    f(i,1,T){
        int x=solve(i);
    }
	return 0;
}

int n,m;
const int N=2e5+5;
const int md=1e9+7;
vector<int>a[N];
int L[N],R[N],level[N],num[N],rnum[N],v[N];
int cnt=0;

int dfs(int x,int pre,int lv){
    int m=a[x].size(),i;
    num[x]=++cnt;rnum[cnt]=x;
    L[cnt]=R[cnt]=cnt;
    level[cnt]=lv;
    f(i,0,m-1){
        if(a[x][i]==pre)continue;
        R[num[x]]=dfs(a[x][i],x,lv+1);
    }
    return R[num[x]];
}
/*
10 17
114 868 664 99 956 278 374 294 474 726
2 6
2 5
3 9
5 8
2 4
8 10
2 3
1 2
5 7
2 4
2 9
2 8
2 2
1 4 326
1 9 664
1 1 494
1 1 25
1 6 1
1 6 522
2 5
2 10
1 1 146
2 5
2 9
2 8
2 3

*/
struct Tree{
    int v,flag[2];	//flag为lazy操作
    void z(){flag[0]=flag[1]=0;}
}tree[4*N];

void build(int n,int l, int r){	//减数
    if(l==r){
        tree[n].v=v[rnum[l]];
        tree[n].z();
        return;
    }
    int mid=(l+r)>>1,n1=n<<1,n2=(n<<1)+1;
    build(n1,l,mid);
    build(n2,mid+1,r);
}

int to(int*a,int x){
    int lv=level[x];
    return lv&1?a[1]-a[0]:a[0]-a[1];
}
int down(int a,int b){
    tree[b].flag[0]+=tree[a].flag[0];
    tree[b].flag[1]+=tree[a].flag[1];
}
int _search(int n, int l ,int r, int x){		//点查询
    if(l==r){
        tree[n].v+=to(tree[n].flag,l);
        tree[n].z();
        return tree[n].v;
    }
    int mid=(l+r)>>1;
    int n1=n<<1,n2=(n<<1)|1;
    down(n,n1);down(n,n2);
    tree[n].z();
    if(x<=mid)
       return  _search(n1,l,mid,x);
    else
       return _search(n2,mid+1,r,x);
}

void update(int n, int l, int r,int x, int y,int val,int k){		//区域更新
    if(x<=l&&y>=r){
            tree[n].flag[k]+=val;
            return;
    }
    int mid=(l+r)>>1;int n1=n<<1,n2=(n<<1)|1;
    if(x<=mid)
        update(n1,l,mid,x,y,val,k);
    if(y>mid)
        update(n2,mid+1,r,x,y,val,k);
}

void print_tree(int n){
    int i,j;
    int num=0;
    for(i=0;int(pow(2,i-1))<=n;++i){
        f(j,1,int(pow(2,i)))
            printf("(%d,%d) ",tree[++num].flag[0],tree[num].flag[1]);
        cout<<endl;
    }
    cout<<endl;
}

int solve(int T){
    int i,j;
    cin>>n>>m;
    f(i,1,n)cin>>v[i];
    f(i,1,n-1){
        int x,y;
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int root=1;
    dfs(root,-1,1);
    build(1,1,n);
   // cout<<endl;
   // f(i,1,n)cout<<rnum[i]<<' ';cout<<endl;
   // f(i,1,n)cout<<L[i]<<' '<<R[i]<<"  ";;cout<<endl;
    f(i,1,m){
        int flag,x,val;
       // print_tree(n);
        cin>>flag;
        if(flag==1){
            cin>>x>>val;
            int p=num[x];
            int k=level[p]%2;
            update(1,1,n,L[p],R[p],val,k);
        }
        else{
            cin>>x;
            cout<<_search(1,1,n,num[x])<<endl;
        }
    }
    return 0;
}


/*

YAHA SE MAT CHAPNA BC. IIIT KA HU. COPYCASE AAYEGA.

*/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define rep(i,l,r) for(int i=l;i<r;i++)
#define rep2(i,r,l) for(int i=r;i>l;i--)
#define sz(a) (int)a.size()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define nl "\n"
#define pii pair<int,int>
const int c=2e5+5;
int strength[c],level[c],sizee[c],visited[c],tree_even[4*c],tree_odd[4*c],M;
std::vector<int> v[c],preorder;
map <int,int> Map;

/*
int dfs(int vertex,int lev)
{
    if(visited[vertex])  return 0;

    visited[vertex]=1;
    level[vertex]=lev;
    sizee[vertex]=1;

    preorder.pb(vertex);
    Map[vertex]=sz(preorder)-1;

    rep(i,0,sz(v[vertex]))  sizee[vertex]+=dfs(v[vertex][i],lev+1);

    return sizee[vertex];
}
*/
ll st[c], ft[c], tim;

void dfs(int n,int p,int lev=0)
{
    st[n]=++tim;
    //vt[tim]=n;
    level[n]=lev;
    for(auto x:v[n])
    {
        if(x==p) continue;
        dfs(x,n,lev+1);
    }
    ft[n]=tim;
}

void update(int index,int s,int e,int l,int r,int val)
{
    if(e<l || s>r)   return;
    if(s>=l && e<=r)
    {
        if(M==0)   tree_even[index]+=val;
        else     tree_odd[index]+=val;
        return;
    }

    int mid=(s+e)/2;
    update(2*index,s,mid,l,r,val);
    update(2*index+1,mid+1,e,l,r,val);
    return;
}

int sum;
int query(int index,int l,int r,int i)
{
    if(i<l || i>r)     return 0;
    if(l<=i && i<=r)
    {
        if(M==0)       sum+= tree_even[index]-tree_odd[index];
        else     sum+= tree_odd[index]-tree_even[index];
    }

    if(l==r)    return 0;

    int mid=(l+r)/2;
    query(2*index,l,mid,i);
    query(2*index+1,mid+1,r,i);
    return 0;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);

    int n,m,v1,v2,type,node,upd,start;
    cin>>n>>m;
    rep(i,1,n+1) cin>>strength[i];

    rep(i,0,n-1)
    {
        cin>>v1>>v2;
        v[v1].pb(v2);
        v[v2].pb(v1);
    }
    preorder.pb(0);
    dfs(1,0);

//    cout<<endl;
//    for(ll i=0; i<preorder.size(); i++)cout<<preorder[i]<<" "; cout<<endl;
//    for(ll i=0; i<=n; i++)cout<<i<<" "<<sizee[i]<<" "<<level[i]<<endl;//;
//    for(auto now : Map) cout<<now.first<<" "<<now.second<<endl;

    while(m--)
    {
        cin>>type;
        if(type==1)
        {
            cin>>node>>upd;
            start=Map[node];
            M=level[node]%2;
            //update(1,1,n,start,start+sizee[node]-1,upd);
            update(1,1,n,st[node],ft[node],upd);
        }
        else
        {
            cin>>node;
            start=Map[node];
            M=level[node]%2;
            sum=strength[node];
            query(1,1,n,st[node]);

            //query(1,1,n,start);
            cout<<sum<<nl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
constexpr int inf = 0x3f3f3f3f;
constexpr double EPS = 1e-30;
constexpr double PI = atan(1) * 4;

template <typename T> inline bool chmax(T& x, T y) {return x < y ? x = y, 1 : 0;}
template <typename T> inline bool chmin(T& x, T y) {return x > y ? x = y, 1 : 0;}
inline int LSB(int i) {return (i & -i);}

//Problem statement: http://codeforces.com/contest/384/problem/E

const int maxn = 2e5+5;

struct Segment{
    Segment* c[2];
    ll sum, lazy;

    Node(){
        memset(c, 0, sizeof(c));
        sum = lazy = 0;
    }

    void combine(){
        sum = 0;
        for (int i = 0; i < 2; i++){
            if (c[i]) sum += c[i]->sum;
        }
    }

    void down(){
        if (lazy){
            for (int i = 0; i < 2; i++){
                if (c[i]){
                    c[i]->lazy += lazy;
                    c[i]->sum += lazy;
                }
            }

            lazy = 0;
        }
    }
} *odd, *even;

int n, m, a[maxn], lvl[maxn], s[maxn], e[maxn], tme[maxn];
vector <int> adj[maxn];

int t;
void dfs(int node, int p){
    s[node] = ++t;
    tme[t] = node;
    for (int i : adj[node]){
        if (i == p) continue;
        lvl[i] = lvl[node] + 1;
        dfs(i, node);
    }

    e[node] = t;
}

void build(Segment*& node, int l, int r, int MOD){
    if (!node) node = new Segment();
    if (l == r){
        if (lvl[tme[l]] % 2 == MOD) node->sum = a[tme[l]];
        return;
    }

    int mid = (l + r) >> 1;
    build(node->c[0], l, mid, MOD);
    build(node->c[1], mid + 1, r, MOD);
    node->combine();
}

void update(Segment*& node, int l, int r, int ql, int qr, int val){
    if (l > r || ql > r || qr < l || ql > qr) return;
    if (!node) node = new Segment();

    if (ql <= l && r <= qr){
        node->sum += val;
        node->lazy += val;
        return;
    }

    node->down();
    int mid = (l + r) >> 1;
    update(node->c[0], l, mid, ql, qr, val);
    update(node->c[1], mid + 1, r, ql, qr, val);
    node->combine();
}

ll query(Segment*& node, int l, int r, int ql, int qr){
    if (l > r || ql > r || qr < l || ql > qr) return 0;
    if (!node) node = new Segment();
    if (ql <= l && r <= qr) return node->sum;

    node->down();
    int mid = (l + r) >> 1;
    return query(node->c[0], l, mid, ql, qr) + query(node->c[1], mid + 1, r, ql, qr);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);

    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1, b, c; i < n; i++){
        cin >> b >> c;
        adj[b].push_back(c);
        adj[c].push_back(b);
    }

    dfs(1, -1);
    build(odd, 1, n, 1);
    build(even, 1, n, 0);

    for (int i = 1, b, c, d; i <= m; i++){
        cin >> b;
        if (b == 1){
            cin >> c >> d;
            if (lvl[c] % 2){
                update(odd, 1, n, s[c], e[c], d);
                update(even, 1, n, s[c], e[c], -d);
            }
            else {
                update(odd, 1, n, s[c], e[c], -d);
                update(even, 1, n, s[c], e[c], d);
            }
        }
        else{
            cin >> c;
            if (lvl[c] % 2) printf("%I64d\n", query(odd, 1, n, s[c], s[c]));
            else printf("%I64d\n", query(even, 1, n, s[c], s[c]));
        }
    }

//    for (int i = 1; i <= n; i++) printf("%d is level %d\n", i, lvl[i]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
constexpr int inf = 0x3f3f3f3f;
constexpr double EPS = 1e-30;
constexpr double PI = atan(1) * 4;

template <typename T> inline bool chmax(T& x, T y) {return x < y ? x = y, 1 : 0;}
template <typename T> inline bool chmin(T& x, T y) {return x > y ? x = y, 1 : 0;}
inline int LSB(int i) {return (i & -i);}

//Problem statement: http://codeforces.com/contest/384/problem/E

const int maxn = 2e5+5;

struct Segment{
    Segment* c[2];
    ll sum, lazy;

    Node(){
        memset(c, 0, sizeof(c));
        sum = lazy = 0;
    }

    void combine(){
        sum = 0;
        for (int i = 0; i < 2; i++){
            if (c[i]) sum += c[i]->sum;
        }
    }

    void down(){
        if (lazy){
            for (int i = 0; i < 2; i++){
                if (c[i]){
                    c[i]->lazy += lazy;
                    c[i]->sum += lazy;
                }
            }

            lazy = 0;
        }
    }
} *odd, *even;

int n, m, a[maxn], lvl[maxn], s[maxn], e[maxn], tme[maxn];
vector <int> adj[maxn];

int t;
void dfs(int node, int p){
    s[node] = ++t;
    tme[t] = node;
    for (int i : adj[node]){
        if (i == p) continue;
        lvl[i] = lvl[node] + 1;
        dfs(i, node);
    }

    e[node] = t;
}

void build(Segment*& node, int l, int r, int MOD){
    if (!node) node = new Segment();
    if (l == r){
        if (lvl[tme[l]] % 2 == MOD) node->sum = a[l];
        return;
    }

    int mid = (l + r) >> 1;
    build(node->c[0], l, mid, MOD);
    build(node->c[1], mid + 1, r, MOD);
    node->combine();
}

void update(Segment*& node, int l, int r, int ql, int qr, int val){
    if (l > r || ql > r || qr < l || ql > qr) return;
    if (!node) node = new Segment();

    if (ql <= l && r <= qr){
        node->sum += val;
        node->lazy += val;
        return;
    }

    node->down();
    int mid = (l + r) >> 1;
    update(node->c[0], l, mid, ql, qr, val);
    update(node->c[1], mid + 1, r, ql, qr, val);
    node->combine();
}

ll query(Segment*& node, int l, int r, int ql, int qr){
    if (l > r || ql > r || qr < l || ql > qr) return 0;
    if (!node) node = new Segment();
    if (ql <= l && r <= qr) return node->sum;

    node->down();
    int mid = (l + r) >> 1;
    return query(node->c[0], l, mid, ql, qr) + query(node->c[1], mid + 1, r, ql, qr);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);

    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1, b, c; i < n; i++){
        cin >> b >> c;
        adj[b].push_back(c);
        adj[c].push_back(b);
    }

    dfs(1, -1);
    build(odd, 1, n, 1);
    build(even, 1, n, 0);
    for (int i = 1, b, c, d; i <= m; i++){
        cin >> b;
        if (b == 1){
            cin >> c >> d;
            if (lvl[c] % 2){
                update(odd, 1, n, s[c], e[c], d);
                update(even, 1, n, s[c], e[c], -d);
            }
            else {
                update(odd, 1, n, s[c], e[c], -d);
                update(even, 1, n, s[c], e[c], d);
            }
        }
        else{
            cin >> c;
            if (lvl[c] % 2) printf("%I64d\n", query(odd, 1, n, s[c], s[c]));
            else printf("%I64d\n", query(even, 1, n, s[c], s[c]));
        }
    }

//    for (int i = 1; i <= n; i++) printf("%d is [%d, %d]\n", i, s[i], e[i]);
    return 0;
}


/*
    Author : manu_sy
*/
#include <bits/stdc++.h>
using namespace std;

/** Template Begins **/

typedef long long        ll;
typedef pair<int,int>    PII;

#define IOS         ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl        '\n'
#define pb          push_back
#define F           first
#define S           second
#define mp          make_pair
#define all(a)      (a).begin(), (a).end()
#define FOR(i,a,b)  for(int i=a;i<=b;i++)
#define LP(i,n)     for(int i=0;i< n;i++)

/* Debug */

template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.F << "," << P.S << ")";
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}

template<class TH> void _dbg(const char *sdbg, TH h){ cerr << sdbg << '=' << h << endl; }

template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',') cerr << *sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

/* Debug Ends */

const int N = 2e5+7;

/** Template Ends **/

int n, m, a[N], par[N], in[N], out[N], id[N], timer;
vector<int> adj[N], g[2][N], nodes[2];

struct BIT {
    vector<int> bit;
    int n;
    BIT () {
        this->n = N + 5;
        bit.assign(this->n + 5, 0);
    }
    void add(int idx, int val) {
        for (++idx; idx < n; idx += idx & -idx)
            bit[idx] += val;
    }
    void range_add(int l, int r, int val) {
        add(l, val);
        add(r + 1, -val);
    }
    int query(int idx) {
        int ret = 0;
        for (++idx; idx > 0; idx -= idx & -idx)
            ret += bit[idx];
        return ret;
    }
} bt[2];

void init(int v, int lvl, int p) {
    if (p)  par[v] = p;
    id[v] = lvl & 1;
    nodes[id[v]].pb(v);

    for (auto ch : adj[v])
        if (ch != p)
        {
            g[id[p]][p].pb(ch);
            init(ch, lvl + 1, v);
        }
}

void dfs(int v, int ii) {
    in[v] = ++timer;

    for (auto ch : g[ii][v])
        dfs(ch, ii);

    out[v] = timer;
}

void add(int v, int val) {
    bt[id[v]].range_add(in[v], out[v], val);
}

int query(int v) {
    return bt[id[v]].query(in[v]);
}

signed main() {

    IOS;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    BIT bt[2];

    for (int i = 0; i < n-1; i++)
    {
        int u, v;   cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    init(1, 0, 0);

    for (int i = 0; i < 2; i++)
    {
        timer = 0;
        for (auto v : nodes[i]) if (!in[v]) dfs(v, i);
    }

    while (m--)
    {
        int q, x, val;  cin >> q >> x;

        if (q == 1)
        {
            cin >> val;
            add(x, val);
        }
        else
        {
            cout << a[x] + query(x) - (par[x] ? query(par[x]) : 0) << endl;
        }
    }
    return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define N 1000005
#define md ll(1000000007)
#define pb push_back
#define fi first
#define se second

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int grand(int x) {
    return uniform_int_distribution<int>(0, x - 1)(rng);
}

string s = "";
ll arr[N] = {0};
ll brr[N] = {0};
ll orr[N] = {0};
ll par[N] = {0};
ll sza[N] = {0};
ll sze[N] = {0};
ll szo[N] = {0};
ll pso[N] = {0};
ll pse[N] = {0};
ll bitve[N] = {0};
ll bitvo[N] = {0};
vector < ll > v;
vector < ll > ve , vo;
vector < ll > g[N], go[N], ge[N];

ll gcd(ll a , ll b){
	if(b==0) return  a;
	if(a == 0 ) return b;
	return gcd(b,a%b) ;
}

void dfs(ll x, ll y){
	arr[x] = 1;
	orr[x] = y;
	for(int i : g[x]){
		if(arr[i] == 1) continue;
		par[i] = x;
		dfs(i,y+1);
	}
}

void dfso(ll x){
	arr[x] = 1;
	pso[x] = vo.size();
	vo.pb(brr[x]);
	for(int i : g[x]){
		if(i == par[x]) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			//cout << x << " " << j << endl;
			go[x].pb(j);
			go[j].pb(x);
			dfso(j);
		}
	}
	/*for(int i : g[x]){
		if(i == par[x] ) continue;
		for(int j :g[i]){
			if(arr[j] == 1) continue;
			dfso(j);
		}
	}*/
}

void dfse(ll x){
	arr[x] = 1;
	pse[x] = ve.size();
	ve.pb(brr[x]);
	for(int i : g[x]){
		if(i == par[x]) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			//cout << x <<" " << j << endl;
			ge[x].pb(j);
			ge[j].pb(x);
			dfse(j);
		}
	}
	/*for(int i : g[x]){
		if(i == par[x] ) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			dfse(j);
		}
	}*/
}

ll gszo(ll x){
	arr[x] = 1;
	ll ans = 1;
	for(int i : go[x]){
		if(arr[i] == 1) continue;
		ans += gszo(i);
		//cout << x << " " << i <<" " << ans <<endl;
	}
	szo[x] = ans;
	return ans;
}

ll gsze(ll x){
	arr[x] = 1;
	ll ans = 1;
	for(int i : ge[x]){
		if(arr[i] == 1) continue;
		ans += gsze(i);
		//cout << x <<" " << i << " " << ans<<endl;
	}
	sze[x] = ans;
	return ans;
}

void updo(ll x, ll val){
	for(int i = x+1; i < N ; i += i&(-i)){
		bitvo[i] += val;
	}
}

ll getsumo(ll x){
	ll sum = 0;
	for(int i = x+1; i > 0; i -= i&(-i)){
		sum += bitvo[i];
	}
	return sum;
}

void upde(ll x, ll val){
	for(int i = x+1; i < N ; i += i&(-i)){
		bitve[i] += val;
	}
}

ll getsume(ll x){
	ll sum = 0;
	for(int i = x+1; i > 0; i -= i&(-i)){
		sum += bitve[i];
	}
	return sum;
}
int main(){

	ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0);

	ll n = 0, m = 0, k = 0, q = 0, ans = 0;
	ll x = 0, y = 0, t = 0, sum = 0, sz = 0;

	cin >> n >>m;

	for(int i = 1 ; i <=n ; i++){
		cin >> brr[i];
	}

	for(int i = 0 ; i  <n-1 ; i++){
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	//cout << endl;
	g[0].pb(1);
	g[1].pb(0);
	vo.pb(0);

	dfs(0,0);

	fill(arr, arr+N, 0);
	dfso(1);

	fill(arr, arr+N, 0);
	dfse(0);

	fill(arr, arr+N, 0);
	gszo(1);

	fill(arr, arr+N, 0);
	gsze(0);

	ll val;

	/*for(int i : vo){
		cout << i <<" ";
	}
	cout << endl;

	for(int i :ve ){
		cout << i <<" ";
	}
	cout << endl;

	for(int i = 0 ; i<=10 ; i++){
		cout << i << " " << orr[i] <<" ";
		if(orr[i] %2 == 1){
			cout << szo[i] << " " << pso[i] << endl;
		}else{
			cout << sze[i] << " " << pse[i] << endl;
		}
	}*/

	for(int i = 1 ; i <vo.size() ; i++){
		updo(i, vo[i] - vo[i-1]);
	}
	for(int i = 1 ; i< ve.size() ; i++){
		upde(i,ve[i] - ve[i-1]);
	}

	for(int i=0 ; i <=n ; i++){
		if(orr[i] %2 == 1){
			for(int j : g[i]){
				if(j == par[i]) continue;
				sza[i] += sze[j];
			}
		}else{
			for(int j : g[i]){
				if(j == par[i]) continue;
				sza[i] += szo[j];
			}
		}
	}

	//cout << "YES" << endl;
	while(m--){
		cin >> q;
		if(q == 1){
			cin >> x >> val;
			if(orr[x]%2 == 1){
				updo(pso[x], val);
				updo(pso[x] + szo[x], -val);
				upde(pse[g[x][0]] , -val);
				upde(pse[g[x][0]] + sza[x] , val);
			}else{
				upde(pse[x], val);
				upde(pse[x] + sze[x], -val);
				updo(pso[g[x][0]] , -val);
				updo(pso[g[x][0]] + sza[x] , val);
			}
		}else{
			cin >> x;
			if(orr[x]%2 == 1){
				cout << getsumo(pso[x])  << endl;
			}else{
				cout << getsume(pse[x])  << endl;
			}
		}
	}

	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define N 1000005
#define md ll(1000000007)
#define pb push_back
#define fi first
#define se second

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int grand(int x) {
    return uniform_int_distribution<int>(0, x - 1)(rng);
}

string s = "";
ll arr[N] = {0};
ll brr[N] = {0};
ll orr[N] = {0};
ll par[N] = {0};
ll sze[N] = {0};
ll szo[N] = {0};
ll pso[N] = {0};
ll pse[N] = {0};
ll bitve[N] = {0};
ll bitvo[N] = {0};
vector < ll > v;
vector < ll > ve , vo;
vector < ll > g[N], go[N], ge[N];

ll gcd(ll a , ll b){
	if(b==0) return  a;
	if(a == 0 ) return b;
	return gcd(b,a%b) ;
}

void dfs(ll x, ll y){
	arr[x] = 1;
	orr[x] = y;
	for(int i : g[x]){
		if(arr[i] == 1) continue;
		par[i] = x;
		dfs(i,y+1);
	}
}

void dfso(ll x){
	arr[x] = 1;
	pso[x] = vo.size();
	vo.pb(brr[x]);
	for(int i : g[x]){
		if(i == par[x]) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			//cout << x << " " << j << endl;
			go[x].pb(j);
			go[j].pb(x);
		}
	}
	for(int i : g[x]){
		if(i == par[x] ) continue;
		for(int j :g[i]){
			if(arr[j] == 1) continue;
			dfso(j);
		}
	}
}

void dfse(ll x){
	arr[x] = 1;
	pse[x] = ve.size();
	ve.pb(brr[x]);
	for(int i : g[x]){
		if(i == par[x]) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			//cout << x <<" " << j << endl;
			ge[x].pb(j);
			ge[j].pb(x);
		}
	}
	for(int i : g[x]){
		if(i == par[x] ) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			dfse(j);
		}
	}
}

ll gszo(ll x){
	arr[x] = 1;
	ll ans = 1;
	for(int i : go[x]){
		if(arr[i] == 1) continue;
		ans += gszo(i);
		//cout << x << " " << i <<" " << ans <<endl;
	}
	szo[x] = ans;
	return ans;
}

ll gsze(ll x){
	arr[x] = 1;
	ll ans = 1;
	for(int i : ge[x]){
		if(arr[i] == 1) continue;
		ans += gsze(i);
		//cout << x <<" " << i << " " << ans<<endl;
	}
	sze[x] = ans;
	return ans;
}

void updo(ll x, ll val){
	for(int i = x+1; i < N ; i += i&(-i)){
		bitvo[i] += val;
	}
}

ll getsumo(ll x){
	ll sum = 0;
	for(int i = x+1; i > 0; i -= i&(-i)){
		sum += bitvo[i];
	}
	return sum;
}

void upde(ll x, ll val){
	for(int i = x+1; i < N ; i += i&(-i)){
		bitve[i] += val;
	}
}

ll getsume(ll x){
	ll sum = 0;
	for(int i = x+1; i > 0; i -= i&(-i)){
		sum += bitve[i];
	}
	return sum;
}
int main(){

	ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0);

	ll n = 0, m = 0, k = 0, q = 0, ans = 0;
	ll x = 0, y = 0, t = 0, sum = 0, sz = 0;

	cin >> n >>m;

	for(int i = 1 ; i <=n ; i++){
		cin >> brr[i];
	}

	for(int i = 0 ; i  <n-1 ; i++){
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	//cout << endl;
	g[0].pb(1);
	g[1].pb(0);
	vo.pb(0);

	dfs(0,0);

	fill(arr, arr+N, 0);
	dfso(1);

	fill(arr, arr+N, 0);
	dfse(0);

	fill(arr, arr+N, 0);
	gszo(1);

	fill(arr, arr+N, 0);
	gsze(0);

	ll val;

	/*for(int i : vo){
		cout << i <<" ";
	}
	cout << endl;

	for(int i :ve ){
		cout << i <<" ";
	}
	cout << endl;

	for(int i = 0 ; i<=5 ; i++){
		cout << i << " " << orr[i] <<" ";
		if(orr[i] %2 == 1){
			cout << szo[i] << " " << pso[i] << endl;
		}else{
			cout << sze[i] << " " << pse[i] << endl;
		}
	}*/

	for(int i = 1 ; i <vo.size() ; i++){
		updo(i, vo[i] - vo[i-1]);
	}
	for(int i = 1 ; i< ve.size() ; i++){
		upde(i,ve[i] - ve[i-1]);
	}
	//cout << "YES" << endl;
	while(m--){
		cin >> q;
		if(q == 1){
			cin >> x >> val;
			if(orr[x]%2 == 1){
				updo(pso[x], val);
				updo(pso[x] + szo[x], -val);
				upde(pse[par[x]] + 1, -val);
				upde(pse[par[x]] + sze[par[x]], val);
			}else{
				upde(pse[x], val);
				upde(pse[x] + sze[x], -val);
				updo(pso[par[x]] + 1, -val);
				updo(pso[par[x]] + szo[par[x]], val);
			}
		}else{
			cin >> x;
			if(orr[x]%2 == 1){
				cout << getsumo(pso[x])  << endl;
			}else{
				cout << getsume(pse[x])  << endl;
			}
		}
	}

	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define N 1000005
#define md ll(1000000007)
#define pb push_back
#define fi first
#define se second

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int grand(int x) {
    return uniform_int_distribution<int>(0, x - 1)(rng);
}

string s = "";
ll arr[N] = {0};
ll brr[N] = {0};
ll orr[N] = {0};
ll son[N] = {0};
ll par[N] = {0};
ll sza[N] = {0};
ll sze[N] = {0};
ll szo[N] = {0};
ll pso[N] = {0};
ll pse[N] = {0};
ll bitve[N] = {0};
ll bitvo[N] = {0};
vector < ll > v;
vector < ll > ve , vo;
vector < ll > g[N], go[N], ge[N];

ll gcd(ll a , ll b){
	if(b==0) return  a;
	if(a == 0 ) return b;
	return gcd(b,a%b) ;
}

void dfs(ll x, ll y){
	arr[x] = 1;
	orr[x] = y;
	ll z = 0;
	for(int i : g[x]){
		if(arr[i] == 1) continue;
		if(z == 0){
			son[x] = i;
			z = 1;
		}
		par[i] = x;
		dfs(i,y+1);
	}
}

void dfso(ll x){
	arr[x] = 1;
	pso[x] = vo.size();
	vo.pb(brr[x]);
	for(int i : g[x]){
		if(i == par[x]) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			//cout << x << " " << j << endl;
			go[x].pb(j);
			go[j].pb(x);
			dfso(j);
		}
	}
	/*for(int i : g[x]){
		if(i == par[x] ) continue;
		for(int j :g[i]){
			if(arr[j] == 1) continue;
			dfso(j);
		}
	}*/
}

void dfse(ll x){
	arr[x] = 1;
	pse[x] = ve.size();
	ve.pb(brr[x]);
	for(int i : g[x]){
		if(i == par[x]) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			//cout << x <<" " << j << endl;
			ge[x].pb(j);
			ge[j].pb(x);
			dfse(j);
		}
	}
	/*for(int i : g[x]){
		if(i == par[x] ) continue;
		for(int j : g[i]){
			if(arr[j] == 1) continue;
			dfse(j);
		}
	}*/
}

ll gszo(ll x){
	arr[x] = 1;
	ll ans = 1;
	for(int i : go[x]){
		if(arr[i] == 1) continue;
		ans += gszo(i);
		//cout << x << " " << i <<" " << ans <<endl;
	}
	szo[x] = ans;
	return ans;
}

ll gsze(ll x){
	arr[x] = 1;
	ll ans = 1;
	for(int i : ge[x]){
		if(arr[i] == 1) continue;
		ans += gsze(i);
		//cout << x <<" " << i << " " << ans<<endl;
	}
	sze[x] = ans;
	return ans;
}

void updo(ll x, ll val){
	for(int i = x+1; i < N ; i += i&(-i)){
		bitvo[i] += val;
	}
}

ll getsumo(ll x){
	ll sum = 0;
	for(int i = x+1; i > 0; i -= i&(-i)){
		sum += bitvo[i];
	}
	return sum;
}

void upde(ll x, ll val){
	for(int i = x+1; i < N ; i += i&(-i)){
		bitve[i] += val;
	}
}

ll getsume(ll x){
	ll sum = 0;
	for(int i = x+1; i > 0; i -= i&(-i)){
		sum += bitve[i];
	}
	return sum;
}
int main(){

	ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0);

	ll n = 0, m = 0, k = 0, q = 0, ans = 0;
	ll x = 0, y = 0, t = 0, sum = 0, sz = 0;

	cin >> n >>m;

	for(int i = 1 ; i <=n ; i++){
		cin >> brr[i];
	}

	for(int i = 0 ; i  <n-1 ; i++){
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	//cout << endl;
	g[0].pb(1);
	g[1].pb(0);
	vo.pb(0);

	dfs(0,0);

	fill(arr, arr+N, 0);
	dfso(1);

	fill(arr, arr+N, 0);
	dfse(0);

	fill(arr, arr+N, 0);
	gszo(1);

	fill(arr, arr+N, 0);
	gsze(0);

	ll val;

	/*for(int i : vo){
		cout << i <<" ";
	}
	cout << endl;

	for(int i :ve ){
		cout << i <<" ";
	}
	cout << endl;

	for(int i = 0 ; i<=10 ; i++){
		cout << i << " " << orr[i] <<" ";
		if(orr[i] %2 == 1){
			cout << szo[i] << " " << pso[i] << endl;
		}else{
			cout << sze[i] << " " << pse[i] << endl;
		}
	}*/

	for(int i = 1 ; i <vo.size() ; i++){
		updo(i, vo[i] - vo[i-1]);
	}
	for(int i = 1 ; i< ve.size() ; i++){
		upde(i,ve[i] - ve[i-1]);
	}

	for(int i=0 ; i <=n ; i++){
		if(orr[i] %2 == 1){
			for(int j : g[i]){
				if(j == par[i]) continue;
				sza[i] += sze[j];
			}
		}else{
			for(int j : g[i]){
				if(j == par[i]) continue;
				sza[i] += szo[j];
			}
		}
	}

	//cout << "YES" << endl;
	while(m--){
		cin >> q;
		if(q == 1){
			cin >> x >> val;
			if(orr[x]%2 == 1){
				updo(pso[x], val);
				updo(pso[x] + szo[x], -val);
				if(g[x].size() != 0) upde(pse[son[x]] , -val);
				if(g[x].size() != 0) upde(pse[son[x]] + sza[x] , val);
			}else{
				upde(pse[x], val);
				upde(pse[x] + sze[x], -val);
				if(g[x].size() != 0) updo(pso[son[x]] , -val);
				if(g[x].size() != 0) updo(pso[son[x]] + sza[x] , val);
			}
		}else{
			cin >> x;
			if(orr[x]%2 == 1){
				cout << getsumo(pso[x])  << endl;
			}else{
				cout << getsume(pse[x])  << endl;
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ft               first
#define sd               second
// #define MOD              1000000007ll

const int dx[]={-1,0,1,0};
const int dy[]={0,-1,0,1};

const int N = 2e5+4;
#define ll long long
const ll MOD = 1e9+7;
ll INF = 2e18;

ll power(ll a, ll b, ll mod) {
    ll res = 1;
    a %= mod;
    while(b) {
        if(b & 1LL) {
            res *= a;
            res %= mod;
        }
        a = a * a % mod;
        b >>= 1LL;
    }
    return res % mod;
}

int n;

void sos(int l, int r, int arr[]) {   // sos(0, (1<<24), F);

	if(l+1 == r) return;

	int mid = (l + r) >> 1;
	sos(l, mid, arr);
	sos(mid, r, arr);
	int len = (r - l) >> 1;

	for(int i=l; i<mid; i++) {
		arr[i+len] += arr[i];
	}
}
vector<vector<int> > g(N, vector<int>());
int lev[N], timer = 0, start[N], finish[N];
int BIT[N];

void upd(int x, int val) {
	for(; x<N; x+=x&-x) BIT[x] += val;
}

int qry(int x) {
	int ans = 0;
	for(; x>0; x-=x&-x) ans += BIT[x];
	return ans;
}

void dfs(int curr, int par, int l) {
	start[curr] = ++timer;
	lev[curr] = l;
	for(int x: g[curr]) {
		if(x != par) dfs(x, curr, l^1);
	}
	finish[curr] = timer;
}

int main() {
	int m;
	cin >> n >> m;
	int u, v, a[n+4];
	for(int i=1; i<=n; i++) cin >> a[i];
	for(int i=1; i<n; i++) {
		cin >> u >> v;
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(1, 0, 0);
	while(m--) {
		int ty;
		cin >> ty;
		if(ty == 1) {
			int x, val; cin >> x >> val;
			if(lev[x]) {
				upd(start[x], -val);
				upd(finish[x]+1, val);
			}
			else {
				upd(start[x], val);
				upd(finish[x]+1, -val);
			}
		}
		else {
			int x;
			cin >> x;
			if(lev[x]) cout << a[x] - qry(start[x]) << '\n';
			else cout << a[x] + qry(start[x]) << '\n';
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ft               first
#define sd               second
// #define MOD              1000000007ll

const int dx[]={-1,0,1,0};
const int dy[]={0,-1,0,1};

const int N = 2e5+4;
#define ll long long
const ll MOD = 1e9+7;
ll INF = 2e18;

ll power(ll a, ll b, ll mod) {
    ll res = 1;
    a %= mod;
    while(b) {
        if(b & 1LL) {
            res *= a;
            res %= mod;
        }
        a = a * a % mod;
        b >>= 1LL;
    }
    return res % mod;
}

int n;

void sos(int l, int r, int arr[]) {   // sos(0, (1<<24), F);

	if(l+1 == r) return;

	int mid = (l + r) >> 1;
	sos(l, mid, arr);
	sos(mid, r, arr);
	int len = (r - l) >> 1;

	for(int i=l; i<mid; i++) {
		arr[i+len] += arr[i];
	}
}
vector<vector<int> > g(N, vector<int>());
int lev[N], timer = 0, start[N], finish[N];
int BIT[N];

void upd(int x, int val) {
	for(; x<N; x+=x&-x) BIT[x] += val;
}

int qry(int x) {
	int ans = 0;
	for(; x>0; x-=x&-x) ans += BIT[x];
	return ans;
}

void dfs(int curr, int par, int l) {
	start[curr] = ++timer;
	lev[curr] = l;
	for(int x: g[curr]) {
		if(x != par) dfs(x, curr, l^1);
	}
	finish[curr] = timer;
}

int main() {
	int m;
	cin >> n >> m;
	int u, v, a[n+4];
	for(int i=1; i<=n; i++) cin >> a[i];
	for(int i=1; i<n; i++) {
		cin >> u >> v;
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(1, 0, 0);
	while(m--) {
		int ty;
		cin >> ty;
		if(ty == 1) {
			int x, val; cin >> x >> val;
			if(lev[x]) {
				upd(start[x], -val);
				upd(finish[x]+1, val);
			}
			else {
				upd(start[x], val);
				upd(finish[x]+1, -val);
			}
		}
		else {
			int x;
			cin >> x;
			if(lev[x]) cout << a[x] - qry(x) << '\n';
			else cout << a[x] + qry(x) << '\n';
		}
	}
	return 0;
}


//#include<cstdio>
//#include<cstdlib>
#include <iostream>
#include <vector>
#include <queue>
//#include<bitset>
//#include<string>
//#include<stack>
//#include<set>
//#include<unordered_set>
//#include<map>
//#include<unordered_map>
//#include<cstring>
//#include<complex>
#include <math.h>
//#include<iomanip>
//#include<numeric>
#include <algorithm>
#include <stdio.h>
//#include<list>
//#include<functional>
//#include<cassert>
using namespace std;
#define ll long long int
#define llu unsigned long long int
#define v vector<ll>
//#define vv vector<ll>
void pv(vector<ll> arr, ll size)
{

    for (ll i = 0; i < size; i++)
    {
        cout << arr[i] << ' ';
    }
}
void gv(vector<ll> &arr)
{
    ll size = arr.size();
    for (ll i = 0; i < size; i++)
    {
        cin >> arr[i];
    }
}
int main(void)
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin >> n;
    v arr(n);
    gv(arr);
    if (arr[0] != arr[n - 1])
    {
        cout << n - 1 << "\n";
        return 0;
    }
    ll c = arr[0];
    ll k, g;
    for (ll i = 0; i < n; i++)
    {
        if (arr[i] != arr[0])
        {
            k = i + 1;
            break;
        }
    }
    for (ll i = n - 1; i >= 0; i--)
    {
        if (arr[i] != arr[n - 1])
        {
            g = i + 1;
            break;
        }
    }
    cout << max(g - 1, n - k);
    return 0;
}