#include <bits/stdc++.h>
#define ll long long
#define INF 1e18
using namespace std;

void solve(vector<vector<int>>& graph, vector<int>& iznosi, int n)
{
    ll vert = -1, mn = INF;
    for(int i = 1; i<=n; i++)
    {
        ll ans = 0;
        vector<pair<int, int>> paths(n+1, {INF, -1});
        priority_queue <int> dfs;

        paths[i]={0, 0};
        dfs.push(i);

        while(!dfs.empty())
        {
            int vert = dfs.top();
            dfs.pop();

            for(auto g : graph[vert])
            {
                int tp = paths[vert].first + +1;
                if(tp<paths[g].first)
                {
                    paths[g].first=tp;
                    paths[g].second = paths[vert].second+1;
                    dfs.push(g);
                }

            }
        }

        for(int j = 0; j<n; j++)
        {
            ans+=iznosi[j+1]*paths[j+1].first;
        }
        if(ans<mn)
        {
            mn=ans;
            vert=i;
        }

    }
    cout<<vert<<"\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

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

    vector<int> iznosi(n+1);

    for(int i = 1; i<=n; cin>>iznosi[i++]);

    solve(graph, iznosi, n);
    int q;cin>>q;
    for(int i = 0; i<q; i++)
    {
        int a, b;cin>>a>>b;
        iznosi[b]+=a;
        solve(graph, iznosi, n);
    }


    return 0;
}