#include <cstdio>
#define int long long
using namespace std;
#define N 1000005
int n, m, r, cnt, in[N], out[N], c[N], w[N],sum[N],num[N];
inline int lowbit(int x) { return x & (-x); }
struct edge {
int to, next;
} e[N << 1];
int head[N], tot;
inline void add(int u, int v) {
e[++tot] = (edge){ v, head[u] };
head[u] = tot;
}
void dfs(int u, int f) {
in[u] = ++cnt;
num[cnt] = u;
for (int i = head[u]; i; i = e[i].next) {
int v = e[i].to;
if (v == f)
continue;
dfs(v, u);
}
out[u] = cnt;
}
inline void update(int x, int a) {
for (int i = x; i <= n; i += lowbit(i)) c[i] += a,sum[i] += (x-1) * a;
}
inline int ask(int x) {
int ans = 0;
for (int i = x; i; i -= lowbit(i)) ans += x * c[i] - sum[i];
return ans;
}
signed main() {
scanf("%lld%lld%lld", &n, &m, &r);
int op, u, v;
for (int i = 1; i <= n; ++i) scanf("%lld", &w[i]);
for (int i = 1; i < n; ++i) {
scanf("%lld%lld", &u, &v);
add(u, v); add(v, u);
}
dfs(r, 0);
for (int i = 1; i <= n; ++i) update(in[i], w[i] - w[num[in[i]- 1]]);
while (m--) {
scanf("%lld%lld", &op, &u);
if (op == 1) {
scanf("%lld", &v);
update(in[u], v); update(out[u] + 1,-v);
} else
printf("%lld\n", ask(out[u]) - ask(in[u] - 1));
}
}