#include<iostream>
#include<cstdio>
#define int long long
using namespace std;
struct tree{
int son=0,father=0,brother=0,bing=0;
}a[1000005];
int n,m,q,x,y,p,br[1000005];
void dg(int x){
a[x].bing+=y;
if(a[x].brother!=0)dg(a[x].brother);
if(a[x].son!=0)dg(a[x].son);
return ;
}
void erzi(int x){
a[x].bing+=y;
if(a[x].brother!=0)erzi(a[x].brother);
}
signed main(){
//freopen("deploy.in","r",stdin);
//freopen("deploy.out","w",stdout);
cin>>n;
for(int i=1;i<=n;++i)cin>>a[i].bing;
for(int i=1;i<n;++i){
scanf("%lld%lld",&x,&y);
if(br[x]==0){
a[x].son=y;
a[y].father=x;
br[x]=y;
}
else{
a[br[x]].brother=y;
a[y].father=x;
br[x]=y;
}
}
// for(int i=1;i<=n;++i){
// cout<<a[i].brother<<" "<<a[i].father<<" "<<a[i].son<<endl;
//}
cin>>m;
while(m--){
scanf("%lld%lld%lld",&p,&x,&y);
if(p==1){
a[x].bing+=y;
dg(a[x].son);
}
else{
a[a[x].father].bing+=y;
a[x].bing+=y;
erzi(a[x].son);
}
}
cin>>q;
while(q--){
cin>>x;
cout<<a[x].bing<<endl;
}
return 0;
}
我爆零力(悲),有没有大佬给我调一下或者给个hack数据qwq