#include<bits/stdc++.h>
#define int long long
using namespace std;
const int Max=2e5+10;
int n,q;
int fa[Max];
int b[Max],l[Max];
vector<int> child[Max];
int dfn[Max];
int last[Max];
int bb[Max];
int ll[Max];
int _1st[Max];
int _2nd[Max];
int _3rd[Max];
int cnt_st[Max];
void dfs(int u){
dfn[u]=++dfn[0];
_1st[u]=b[u];
cnt_st[u]=1;
bb[dfn[u]]=b[u];
ll[dfn[u]]=l[u];
for(auto v:child[u]){
dfs(v);
///////////////////////////
if(_1st[v]>=_1st[u]){
if(_1st[v]==_1st[u]){
cnt_st[u]+=cnt_st[v];
} else {
cnt_st[u]=1;
_3rd[u]=_2nd[u];
_2nd[u]=_1st[u];
_1st[u]=_1st[v];
}
} else if(_1st[v]>=_2nd[u]){
if(_1st[v]>_2nd[u]){
_3rd[u]=_2nd[u];
_2nd[u]=_1st[v];
}
} else if(_1st[v]>_3rd[u]){
_3rd[u]=_1st[v];
}
///////////////////////////
if(_2nd[v]>=_2nd[u]){
if(_2nd[v]>_2nd[u]){
_3rd[u]=_2nd[u];
_2nd[u]=_2nd[v];
}
} else if(_2nd[v]>_3rd[u]){
_3rd[u]=_2nd[v];
}
//////////////////////////
if(_3rd[v]>_3rd[u]){
_3rd[u]=_3rd[v];
}
}
last[u]=dfn[0];
}
int ps_1st[Max];
int ps_2nd[Max];
int ss_1st[Max];
int ss_2nd[Max];
void init(){
for(int i=1;i<=n;i++){
ps_1st[i]=ps_1st[i-1];
ps_2nd[i]=ps_2nd[i-1];
if(ll[i]==ps_1st[i]){
continue;
}
if(ll[i]>ps_1st[i]){
ps_2nd[i]=ps_1st[i];
ps_1st[i]=ll[i];
} else if(ll[i]>ps_2nd[i]){
ps_2nd[i]=ll[i];
}
}
for(int i=n;i>=1;i--){
ss_1st[i]=ss_1st[i+1];
ss_2nd[i]=ss_2nd[i+1];
if(ll[i]==ss_1st[i]){
continue;
}
if(ll[i]>ss_1st[i]){
ss_2nd[i]=ss_1st[i];
ss_1st[i]=ll[i];
} else if(ll[i]>ss_2nd[i]){
ss_2nd[i]=ll[i];
}
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
cin>>n>>q;
for(int i=2;i<=n;i++){
cin>>fa[i];
child[fa[i]].push_back(i);
}
for(int i=1;i<=n;i++){
cin>>b[i]>>l[i];
}
dfs(1);
init();
int u;
while(q--){
cin>>u;
int res=0;
int maxl=0;
int scdl=0;
if(ps_1st[dfn[u]-1]==ss_1st[last[u]+1]){
maxl=ps_1st[dfn[u]-1];
scdl=max(ps_2nd[dfn[u]-1],ss_2nd[last[u]+1]);
} else {
if(ps_1st[dfn[u]-1]>ss_1st[last[u]+1]){
maxl=ps_1st[dfn[u]-1];
scdl=max(ps_2nd[dfn[u]-1],ss_1st[last[u]+1]);
} else {
maxl=ss_1st[last[u]+1];
scdl=max(ps_1st[dfn[u]-1],ss_2nd[last[u]+1]);
}
}
if(_2nd[u]){
res=max(res,_2nd[u]);
if(maxl){
if(_2nd[u]+maxl>_1st[u]){
res=max(res,_1st[u]);
}
if(_2nd[u]+maxl==_1st[u]){
if(_3rd[u]){
res=max(res,_3rd[u]+maxl);
}
if(scdl){
res=max(res,_2nd[u]+scdl);
}
}
if(_2nd[u]+maxl<_1st[u]){
res=max(_2nd[u]+maxl,res);
}
}
}
if(cnt_st[u]>1&&maxl){
res=max(res,_1st[u]);
}
cout<<res<<'\n';
}
return 0;
}
/*
time:
mem:
7 3
1 2 1 2 4 4
3 0
1 3
2 0
5 2
4 1
3 1
2 2
1
2
4
5 1
1 2 3 4
1 1
1 1
1 1
1 1
1 1
2
*/