#include<bits/stdc++.h>
#define int long long
#define rg register
#define il inline
#define TT(T, Args) template<typename T, typename... Args>
#define up(i, a, b) for (rg int i = (a); i <= (b); i++)
#define down(i, a, b) for (rg int i = (a); i >= (b); i--)
#define rep(i, a) for (rg auto i : a)
using namespace std;
namespace xmpl_{
#define SIZE (1 << 24)
namespace Fast_read{
char buf[SIZE], *S, *T;
il char Getchar(){
if (S == T){
T = (S = buf) + fread(buf, 1, SIZE, stdin);
if (S == T) return '\n';
}
return *S++;
}
}
namespace Fast_write{
char buf[SIZE], *S = buf, *T = buf + SIZE;
il void flush(){
fwrite(buf, 1, S - buf, stdout);
S = buf;
}
il void Putchar(char c){
*S++ = c;
if (S == T) flush();
}
struct F{
~F(){
flush();
}
}fly;
#undef SIZE
}
#define gc Fast_read::Getchar
#define pc Fast_write::Putchar
il int fast_rd(){
int f = 1, x = 0;
char ch = gc();
while(ch < '0' || ch > '9'){
if (ch == '-') f = -1;
ch = gc();
}
while(ch >= '0' && ch <= '9'){
x = x * 10 + ch - '0';
ch = gc();
}
return x * f;
}
il void fast_wt(int x){
if (x < 0){
pc('-');
x = -x;
}
if (x > 9) fast_wt(x / 10);
pc(x % 10 + 48);
}
il string fast_rds(){
string s = "";
char ch = gc();
while((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')){
s += ch;
ch = gc();
}
return s;
}
il void fast_wts(string s){
for (int i = 0; i < s.size(); i++) pc(s[i]);
}
il int rd(){
int f = 1, x = 0;
char ch = getchar();
while(ch < '0' || ch > '9'){
if (ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9'){
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
TT(T, Args) il void rd(T &x){
int f = 1;
x = 0;
char ch = getchar();
while(ch < '0' || ch > '9'){
if (ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9'){
x = x * 10 + ch - '0';
ch = getchar();
}
x *= f;
}
TT(T, Args) il void rd(T &x, Args &...args){
rd(x), rd(args...);
}
TT(T, Args) il void fast_rd(T &x){
int f = 1;
x = 0;
char ch = gc();
while(ch < '0' || ch > '9'){
if (ch == '-') f = -1;
ch = gc();
}
while(ch >= '0' && ch <= '9'){
x = x * 10 + ch - '0';
ch = gc();
}
x *= f;
}
TT(T, Args) il void fast_rd(T &x, Args &...args){
fast_rd(x), fast_rd(args...);
}
il void wt(int x){
if (x < 0){
putchar('-');
x = -x;
}
if (x > 9) wt(x / 10);
putchar(x % 10 + 48);
}
il string rds(){
string s = "";
char ch = getchar();
while((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')){
s += ch;
ch = getchar();
}
return s;
}
il void wts(string s){
for (int i = 0; i < s.size(); i++) putchar(s[i]);
}
il int max(int x, int y){
return (x > y ? x : y);
}
il int min(int a, int b){
return (a < b ? a : b);
}
il int max(int x, int y, int z){
return max(x, max(y, z));
}
il int min(int a, int b, int c){
return min(a, min(b, c));
}
il int qmul(int a, int b, int p){
int res = 0;
while(b){
if (b & 1) res = (res + a) % p;
a = (a + a) % p;
b >>= 1ll;
}
return res;
}
il int qpow(int a, int b, int p){
int res = 1;
while(b){
if (b & 1) res = qmul(res, a, p);
a = qmul(a, a, p);
b >>= 1ll;
}
return res;
}
const int Q = 1e6 + 5;
int fac[Q] = {0}, inv[Q] = {0}, finv[Q] = {0};
il void init(int n, int p){
fac[0] = inv[0] = finv[0] = fac[1] = inv[1] = finv[1] = 1;
for (int i = 2; i <= n; i++){
fac[i] = 1ll * fac[i - 1] * i % p;
inv[i] = (p - 1ll * p / i * inv[p % i] % p) % p;
finv[i] = 1ll * finv[i - 1] * inv[i] % p;
}
}
il int A(int n, int m, int p){
if (m > n || m < 0) return 0;
return 1ll * fac[n] * finv[n - m] % p;
}
il int C(int n, int m, int p){
if (m > n || m < 0) return 0;
return 1ll * fac[n] * finv[m] % p * finv[n - m] % p;
}
il int Lucas(int n, int m, int p){
if (!m) return 1;
return (1ll * C(n % p, m % p, p) * Lucas(n / p, m / p, p)) % p;
}
il int gcd(int a, int b){
if (!b) return a;
return gcd(b, a % b);
}
il int lcm(int a, int b){
return 1ll * a * b / gcd(a, b);
}
const int W = 1e5 + 5;
struct int64{
int d[W];
int64(){
memset(d, 0, sizeof(d));
d[0] = 1;
}
int64(int x){
int64();
int it = 0;
while(x){
d[++it] = x % 10;
x /= 10;
}
d[0] = it;
}
bool operator < (const int64 &x) const{
if (d[0] ^ x.d[0]) return d[0] < x.d[0];
int it = d[0];
while(d[it] == x.d[it] && it > 1) it--;
if (it >= 1) return d[it] < x.d[it];
else return 0;
}
int64 operator * (const int &x){
int64 ans;
int len;
ans.d[0] = d[0];
for (int i = 1; i <= d[0]; i++) ans.d[i] = d[i] * x;
for (int i = 1; i <= ans.d[0] || ans.d[i]; i++){
ans.d[i + 1] += ans.d[i] / 10;
ans.d[i] %= 10;
len = i + 1;
}
ans.d[0] = len;
if (!ans.d[len]) ans.d[0]--;
return ans;
}
int64 operator / (const int &x){
int64 ans;
ans.d[0] = d[0];
int res = 0;
for (int i = d[0]; i >= 1; i--){
res = res * 10 + d[i];
ans.d[i] = res / x;
res %= x;
}
while(!ans.d[ans.d[0]] && ans.d[0] > 1) ans.d[0]--;
return ans;
}
};
std::ostream &operator << (std::ostream &ans, const int64 &x){
for (int i = x.d[0]; i >= 1; i--) ans << x.d[i];
return ans;
}
}
using namespace xmpl_;
using namespace std;
const int N = 4e5 + 5, M = 1e6 + 5, K = 2e6 + 5;
int n, q, fa[N], b[N], l[N], s;
int max1[N], max2[N], max3[N], imax1[N], imax2[N], omax1[N], omax2[N];
vector<int> g[N];
il void init(){
}
il void clear(){
}
il void dfs(int u){
if (!u) return ;
if (g[u].empty()){
max1[u] = b[u], imax1[u] = l[u];
return ;
}
vector<int> vec, vc;
vec.push_back(b[u]);
rep(v, g[u]){
dfs(v);
vec.push_back(max1[v]), vec.push_back(max2[v]), vec.push_back(max3[v]), vc.push_back(imax1[v]);
}
vc.push_back(l[u]);
sort(vec.begin(), vec.end(), greater<int>());
sort(vc.begin(), vc.end(), greater<int>());
max1[u] = vec[0], max2[u] = vec[1], max3[u] = vec[2];
imax1[u] = vc[0], imax2[u] = vc[1];
}
il int dfs2(int u, int mx){
int ans = 0;
if (b[u] ^ mx) ans = mx;
rep(v, g[u]) ans = max(ans, dfs2(v, mx));
return ans;
}
il int calc1(int u){
if (omax1[u]) return omax1[u];
if (u == 1) return omax1[u] = 0;
int f = fa[u], ans = l[f];
rep(v, g[f]){
if (v == u) continue;
ans = max(ans, imax1[v]);
}
return omax1[u] = max(ans, calc1(f));
}
il int calc2(int u){
if (omax2[u]) return omax2[u];
if (u == 1) return omax2[u] = 0;
int f = fa[u];
vector<int> vec;
vec.push_back(l[f]);
rep(v, g[f]){
if (v == u) continue;
vec.push_back(imax1[v]);
vec.push_back(imax2[v]);
}
vec.push_back(omax1[f]);
vec.push_back(calc2(f));
sort(vec.begin(), vec.end(), greater<int>());
return omax2[u] = vec[1];
}
il void calc3(){
up(i, 1, n) calc1(i);
up(i, 1, n) calc2(i);
}
il void work(){
rd(n, q);
up(i, 2, n) fa[i] = rd(), g[fa[i]].push_back(i);
up(i, 1, n) rd(b[i], l[i]), max1[i] = max2[i] = max3[i] = -1, imax1[i] = omax1[i] = omax2[2] = 0;
dfs(1), calc3();
// up(s, 1, n) cout << max1[s] << " " << max2[s] << " " << max3[s] << " " << omax1[s] << " " << omax2[s] << " " << imax1[s] << endl;
while(q--){
s = rd();
if (max2[s] == -1) wt(0);
else if (max3[s] == -1) wt(min(max2[s] + omax1[s], max1[s]));
else if (!omax1[s] && max1[s] == max2[s] && max1[s] == max3[s]) wt(dfs2(s, max1[s]));
else if (max2[s] + omax1[s] > max1[s]) wt(max1[s]);
else if (max2[s] + omax1[s] < max1[s]) wt(max2[s] + omax1[s]);
else{
if (max2[s] ^ max3[s]){
if (omax2[s] + max2[s] > max1[s]) wt(max1[s]);
else if (omax2[s] + max2[s] < max1[s]) wt(omax2[s] + max2[s]);
else wt(min(max1[s], max3[s] + omax1[s]));
}
else{
if (omax2[s] + max2[s] < max1[s]) wt(omax2[s] + max2[s]);
else wt(max1[s]);
}
}
wts("\n");
}
}
/*
10 3
1 1 2 2 3 3 4 4 9
1 7
1 6
1 1
0 1
1 1
1 1
1 1
9 1
2 1
0 1
4
*/
signed main(){
//#define file 114514
#ifdef file
freopen("soldier.in", "r", stdin);
freopen("soldier.out", "w", stdout);
#endif
// init();
int t = 1;
// t = rd();
while(t--){
// clear();
work();
// puts("");
}
return 0;
}