#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>#define md
#define ll long long
#define inf (int) 1e9
#define eps 1e-8
#define N 100010
using namespace std;
struct yts { int x,t,ne;} e[2*N];
struct tree { int l,r; ll sz,sum,ad;} tr[4*N];
int sz[N],son[N],v[N],fa[N],pos[N],left[N],right[N],is[N],top[N];
ll a[N];
int tot=0,num=0;
void put(int x,int y)
{
num++; e[num].x=x; e[num].t=y;
e[num].ne=v[x]; v[x]=num;
}
void dfs1(int x)
{
sz[x]=1; son[x]=0;
for (int i=v[x];i;i=e[i].ne)
{
int y=e[i].t;
if (y!=fa[x])
{
fa[y]=x;
dfs1(y);
sz[x]+=sz[y];
if (sz[y]>sz[son[x]]) son[x]=y;
}
}
}
void dfs2(int x,int pre)
{
pos[x]=left[x]=++tot; is[tot]=x; top[x]=pre;
if (son[x]) dfs2(son[x],pre);
for (int i=v[x];i;i=e[i].ne)
{
int y=e[i].t;
if (y!=son[x]&&y!=fa[x]) dfs2(y,y);
}
right[x]=tot;
}
void build(int i,int l,int r)
{
tr[i].l=l; tr[i].r=r; tr[i].sz=tr[i].r-tr[i].l+1; tr[i].ad=0;
if (l==r) { tr[i].sum=a[is[l]]; return;}
int mid=(l+r)>>1;
build(2*i,l,mid); build(2*i+1,mid+1,r);
tr[i].sum=tr[2*i].sum+tr[2*i+1].sum;
}
void release(int i)
{
int l=2*i,r=2*i+1;
if (tr[i].ad)
{
tr[l].sum+=tr[i].ad*tr[l].sz; tr[l].ad+=tr[i].ad;
tr[r].sum+=tr[i].ad*tr[r].sz; tr[r].ad+=tr[i].ad;
tr[i].ad=0;
}
}
void modify(int i,int l,int r,ll d)
{
//printf("%d %d %d %d %d\n",i,l,r,tr[i].l,tr[i].r);
if (l<=tr[i].l&&tr[i].r<=r) { tr[i].sum+=tr[i].sz*d; tr[i].ad+=d; return;}
release(i);
int mid=(tr[i].l+tr[i].r)>>1;
if (l<=mid) modify(2*i,l,r,d);
if (mid+1<=r) modify(2*i+1,l,r,d);
tr[i].sum=tr[2*i].sum+tr[2*i+1].sum;
}
ll query(int i,int l,int r)
{
if (l<=tr[i].l&&tr[i].r<=r) return tr[i].sum;
release(i);
int mid=(tr[i].l+tr[i].r)>>1;
if (r<=mid) return query(2*i,l,r);
if (mid+1<=l) return query(2*i+1,l,r);
return query(2*i,l,r)+query(2*i+1,l,r);
}
int main()
{
int n,m;
scanf("%d%d",&n,&m);
for (int i=1;i<=n;i++) scanf("%lld",&a[i]);
for (int i=1;i<=n-1;i++)
{
int x,y;
scanf("%d%d",&x,&y);
put(x,y); put(y,x);
}
dfs1(1); dfs2(1,1);
//for (int i=1;i<=n;i++) printf("%d %d %d %d %d\n",i,son[i],pos[i],left[i],right[i]);
build(1,1,n);
for (int tt=1;tt<=m;tt++)
{
int opt,x;ll d;
scanf("%d",&opt);
if (opt==1)
{
scanf("%d%lld",&x,&d);
modify(1,pos[x],pos[x],d);
}
else if (opt==2)
{
scanf("%d%lld",&x,&d);
modify(1,left[x],right[x],d);
}
else
{
ll ans=0;
scanf("%d",&x);
while (x)
{
ans+=query(1,pos[top[x]],pos[x]);
x=fa[top[x]];
}
printf("%lld\n",ans);
}
}
return 0;
}