#include <iostream>
#include <vector>

using namespace std;

#define MAXN 20000

void ispis(int n,int pare[MAXN])
{
    int maxi=pare[0],maxi2=1;
        for(int i=1;i<n;i++)
            if(maxi<pare[i])
        {maxi=pare[i]; maxi2=i+1;}

       cout<<maxi2<<endl;
}
bool dfs(int u,int v,vector<bool>& banka,const vector<vector <int>>& c)
{

    if(u==v) return true;

    if(banka[u]) return false;
    banka[u]=true;
    for(int i : c[u])
     if(dfs(i,v,banka,c))
        return true;

    return false;

}

bool pov(int u, int v, int n, const vector<vector <int>>& c)
{
    vector<bool> banka(n, false);
    return dfs(u,v,banka,c);

}
int main()
{

  int n,q,z;
  cin >> n;
  int pare[n],x[n-1],y[n-1];
  vector<vector<int>> c(n);
  for(int i=0;i<n-1;i++)
    {
        cin >> x[i] >> y[i];
      c[x[i]-1].push_back(y[i]-1);
    }
for(int i=0;i<n;i++)
  cin >> pare[i];



 cin >> q;
 int b[q];
  if(q==0)
  {
    ispis(n,pare);
  }
  else
  {
      if(n%2==0)
       cout<<n/2<<endl;
        else
      cout<< n/2 + 1<<endl;
   for(int i=0;i<q;i++)
    {

      cin >> z>> b[i];
      pare[b[i]-1]+=z;
     if(pov(x[i],y[i],n,c) && i%2==0)
      ispis(n,pare);
      else
       cout<<abs(b[i]-z)<<endl;
    }
  }
    return 0;
}