#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>

using namespace std;
vector<vector<int>> Banke;
vector<vector<int>> BankeNajkrace;
int N;
int min(int x, int y)
{
    return x * (x <= y) + y * (y < x);
}
int DFS(bool visited[],int Pocetni, int Krajnji)
{
    if(Pocetni==Krajnji)
    {
        return 0;
    }
    int Broj = 2000000000;
    visited[Pocetni]=true;
    for(int i = 0; i<N; ++i)
    {
        if(Banke[Pocetni][i]==1 && !visited[i])
        {
            Broj=min(Broj,DFS(visited,i,Krajnji)+1);
        }
    }
    return Broj;
}
int Resi(int Zlatnici[], int N)
{
    int Broj=2000000000;
    int index=-1;
    for(int i = 0; i<N; ++i)
    {
        int x=0;
        for(int j = 0; j<N; ++j)
        {
            x+=Zlatnici[j]*BankeNajkrace[i][j];
        }
        if(x<Broj)
        {
            index=i;
            Broj=x;
        }

    }
    return index+1;
}
int main()
{
    cin>>N;
    bool visited[N];
    memset(visited,0,sizeof(visited));
    for(int i = 0; i<N; ++i)
    {
        vector<int> A;
        for(int j = 0; j<N; ++j)
        {
            A.insert(A.end(),0);
        }
        Banke.insert(Banke.end(),A);
    }
    for(int i = 0; i<N-1; ++i)
    {
        int x,y;
        cin>>x>>y;
        Banke[x-1][y-1]=1;
        Banke[y-1][x-1]=1;
    }
    int Zlatnici[N];
    for(int i = 0; i<N; ++i)
    {
        cin>>Zlatnici[i];
        vector<int> A;
        for(int j = 0; j<N; ++j)
        {
            A.insert(A.end(),0);
        }
        BankeNajkrace.insert(BankeNajkrace.end(),A);
    }
    for(int i = 0; i<N; ++i)
    {
        for(int j = 0; j<=i; ++j)
        {
            BankeNajkrace[i][j]=DFS(visited,i,j);
            BankeNajkrace[j][i]=BankeNajkrace[i][j];
            visited[N];
            memset(visited,0,sizeof(visited));
        }
    }
    int Q;
    cin>>Q;
    int Resenja[Q+1];
    int Z[Q];
    int B[Q];
    Resenja[0]=Resi(Zlatnici,N);
    for(int i = 1; i<Q+1;++i)
    {
        cin>>Z[i-1]>>B[i-1];
        Zlatnici[B[i-1]-1]+=Z[i-1];
        Resenja[i]=Resi(Zlatnici,N);
    }
    for(int i = 0; i<Q+1;++i)
    {
        cout<<Resenja[i]<<endl;
    }
    return 0;
}