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

void solve(vector<vector<int>>& graph, vector<int>& iznosi, int n)
{
    ll vert = -1, mn = 100000000;
    for(int i = 1; i<=n; i++)
    {
        ll ans = 0;
        priority_queue<pair<int, int>> dfs;
        vector <bool> visited(n+1, false);
        dfs.push({i, 0});
        while(!dfs.empty())
        {
            auto tr = dfs.top();
            dfs.pop();
            visited[tr.first]=1;
            for(auto g:graph[tr.first])
            {
                if(!visited[g]){
                    ans += (tr.second+1) * iznosi[g];
                    dfs.push({g, tr.second+1});
                }
            }
        }
        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;
}