#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define ld double
#define ll long long
#define llinf 100000000000000000 // 10^17
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define sz(a) (ll)(a.size())
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}
/*auto start = high_resolution_clock::now();
auto stop = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop - start);
cout << "Time taken by function: " << duration.count() << " microseconds" << endl;*/
#define daj_mi_malo_vremena ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);

using namespace std;
#define maxn 200005
#define lg 20
ll d = 350;
ll n,q,it;
ll a[maxn],in[maxn],out[maxn],st[maxn][lg],minid[maxn][lg],st2[maxn][lg],log1[maxn],fr[maxn];
pll v[maxn];
vector<ll> g[maxn];
ll subsum[maxn],upsum[maxn],sum[maxn],dept[maxn];
void dfssub(ll u,ll p){
    subsum[u] = a[u];
    sum[1]+=dept[u]*a[u];
    for(ll s : g[u]){
        if(s==p) continue;
        dfssub(s,u);
        subsum[u]+=subsum[s];
    }
}
void dfscalc(ll u,ll p){
    if(u!=1){
        sum[u] = sum[p] + upsum[u] - a[u];
        for(ll s : g[u]){
            if(s==p) continue;
            sum[u]-=subsum[s];
        }
    }
    for(ll s : g[u]){
        if(s==p) continue;
        dfscalc(s,u);
    }
}
void calczasve(){
    sum[1] = 0;
    dfssub(1,1);
    ll sve = 0;
    for(ll i = 1;i<=n;i++) sve+=a[i];
    for(ll i = 1;i<=n;i++) upsum[i]=sve-subsum[i];
    dfscalc(1,1);
}
void dfspar(ll u,ll p){
    in[u] = ++it;
    st[u][0] = p;
    minid[u][0] = min(u,p);
    dept[u] = dept[p] + 1;
    for(ll s : g[u]){
        if(s==p) continue;
        dfspar(s,u);
    }
    out[u] = it;
}
vector<ll> euler,old_ind;
void dfs(ll u,ll p){
    ll new_ind=sz(old_ind);
    old_ind.pb(u);
    fr[u]=sz(euler);
    euler.push_back(new_ind);
    for(ll s: g[u]){
        if(s!=p){
            dfs(s,u);
            euler.pb(new_ind);
        }
    }
}
void sparse(ll n){
    ll p=log1[n];
    for(ll i=1;i<=n;i++) st2[i][0]=euler[i];
    for(ll j=1;j<=p;j++){
        ll len=(1<<j);
        ll len1=len/2;
        for(ll i=1;i+len-1<=n;i++){
            st2[i][j] =min(st2[i][j-1],st2[i+len1][j-1]);
        }
    }
}
bool intree(ll u,ll v){return in[v]<=in[u]&&out[v]>=out[u];}
ll lca(ll u,ll v){
    ll l =fr[u],r=fr[v];
    if(l>r) swap(l,r);
    ll len=r-l+1;
    ll p=log1[len];
    return old_ind[min(st2[l][p],st2[r+1-(1<<p)][p])];
}
ll dis(ll u,ll v){
    return dept[u] + dept[v] - 2*dept[lca(u,v)];
}
vector<pll> tu;
ll cursum(ll u){
    ll ans = sum[u];
    for(pll p : tu) ans+=dis(p.fi,u)*p.sc;
    return ans;
}
ll mini(ll x,ll y){
    ll ans = y;
    for(ll j = lg-1;j>=0;j--){
        if(intree(y,st[x][j])) continue;
        ans = min(ans,st[x][j]);
        x = st[x][j];
    }
    return ans;
}
ll get(ll x,ll y){
    ll cx = cursum(x);
    ll cy = cursum(y);
    if(cx<cy) return x;
    if(cy<cx) return y;
    return min(x,y);
}
vector<pll> w;
int main(){
	daj_mi_malo_vremena
	for(ll i = 2;i<maxn;i++) log1[i] = log1[i/2] + 1;
    cin >> n;
    for(ll i = 1;i<=n-1;i++){
        ll x,y; cin >> x >> y;
        g[x].pb(y);
        g[y].pb(x);
    }
    for(ll i = 1;i<=n;i++) cin >> a[i];
    dept[1] = -1;
    dfspar(1,1);
    dfs(1,1);
    sparse(sz(euler));
    calczasve();
    for(ll j = 1;j<lg;j++) for(ll i = 1;i<=n;i++) st[i][j] = st[st[i][j-1]][j-1];
    for(ll j = 1;j<lg;j++) for(ll i = 1;i<=n;i++) minid[i][j] = min(minid[i][j-1],minid[st[i][j-1]][j-1]);
    sum[0] = llinf;
    ll ans = 0;
    for(ll i = 1;i<=n;i++) if(sum[i]<sum[ans]) ans = i;
    cout<<ans<<endl;
    cin >> q;
    for(ll i = 1;i<=q;i++) cin >> v[i].sc >> v[i].fi;
    ll j = 1;
    while(j<=q){
        w.clear();
        for(ll g = 0;g<d;g++){
            if(j+g>q) break;
            w.pb(v[j+g]);
        }
        j+=d;
        tu.clear();
        for(ll i = 0;i<sz(w);i++){
            tu.pb(w[i]);
            ll v = w[i].fi; ll x = w[i].sc;
            ll u = ans;
            ll z = lca(u,v);
            vector<ll> poc; poc.pb(u); poc.pb(v);
            for(ll j = lg-1;j>=0;j--){
                if(intree(z,st[u][j])) continue;
                if(cursum(st[u][j])>=cursum(st[st[u][j]][0])) u = st[u][j];
            }
            for(ll j = lg-1;j>=0;j--){
                if(intree(z,st[v][j])) continue;
                if(cursum(st[v][j])>=cursum(st[st[v][j]][0])) v = st[v][j];
            }
            ll curu = get(st[u][0],u);
            ll curv = get(st[v][0],v);
            ll s;
            if(st[u][0]==z&&st[v][0]==z){
                ans = get(u,get(v,z));
                cout<<ans<<endl;
            }
            else{
                ll last = ans;
                ans = get(curu,get(curv,get(ans,z)));
                if(intree(w[i].fi,ans)) s = w[i].fi;
                else s = last;
                ll minsum = cursum(ans);
                for(ll j = lg-1;j>=0;j--){
                    if(intree(st[s][j],ans)&&ans!=s) continue;
                    if(cursum(st[s][j])>minsum) s = st[s][j];
                }
                if(minsum==cursum(z)){
                    s = w[i].fi;
                    for(ll j = lg-1;j>=0;j--){
                        if(intree(z,st[s][j])) continue;
                        if(cursum(st[s][j])>minsum) s = st[s][j];
                    }
                    s = st[s][0];
                    ans = get(ans,mini(s,z));
                    s = last;
                    for(ll j = lg-1;j>=0;j--){
                        if(intree(z,st[s][j])) continue;
                        if(cursum(st[s][j])>minsum) s = st[s][j];
                    }
                    s = st[s][0];
                    ans = get(ans,mini(s,z));
                }else{
                    for(ll j = lg-1;j>=0;j--){
                        if(intree(ans,st[s][j])) continue;
                        if(cursum(st[s][j])>minsum) s = st[s][j];
                    }
                    s = st[s][0];
                    ans = mini(s,ans);
                }
                cout<<ans<<endl;
            }
        }
        for(pll p : w) a[p.fi]+=p.sc;
        calczasve();
    }
	return 0;
}