#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define pb push_back
#define fi first
#define se second
#define en '\n'
#define sp ' '
#define tb '\t'
#define ri(n) int n; cin >> n
#define rl(n) ll n; cin >> n
#define rs(s) string s; cin >> s
#define rc(c) char c; cin >> c
#define rv(v) for (auto &x : v) cin >> x
#define pven(v) for (auto x : v) cout << x << en
#define pv(v) for (auto x : v) cout << x << sp; cout << en
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define yes cout << "YES" << en
#define no cout << "NO" << en
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
#define ssort(a, b) if (a < b) swap(a, b)
#define bitcnt(a) (__builtin_popcountll(a))
#define bithigh(a) (63-__builtin_clzll(a))
#define lg bithigh
#define highpow(a) (1LL << (ll)lg(a))

using namespace std;

const ll LINF = 4e18;
const int mxN = 2e5+10, INF = 2e9;
ll n, m, a[mxN];
vector<int> g[mxN];

namespace Brute{

    ll dp[mxN], sum[mxN], ans[mxN];

    void dfs(int s, int p){

        sum[s] = a[s];
        for (int u : g[s]){
            if (u^p){
                dfs(u, s);
                sum[s] += sum[u];
                dp[s] += dp[u] + sum[u];
            }
        }
    }

    void ReRoot(int p, int s){

        if (!~p) return;

        dp[p] -= dp[s] + sum[s];
        sum[p] -= sum[s];

        dp[s] += dp[p] + sum[p];
        sum[s] += sum[p];
    }

    void dfs1(int s, int p){

        ReRoot(p, s);
        ans[s] = dp[s];
        for (int u : g[s])
            if (u^p)
                dfs1(u, s);
        ReRoot(s, p);
    }

    int Calc(){
        dfs(0, -1);
        dfs1(0, -1);
        int s = 0;
        for (int i = 1; i < n; i++)
            if (ans[i] < ans[s]) s = i;
        return s;
    }

    void Solve(){
        cout << Calc()+1 << en;
        while (m--){
            rl(x); ri(s); s--;
            a[s] += x;
            cout << Calc()+1 << en;
        }
    }
}

namespace Chain{

    struct BIT{
        int n;
        vector<ll> tree;
    public:
        void Assign(int s){
            n = s;
            tree.assign(s+1, 0);
        }
        int walk(ll x, bool f(ll)) const {
            int pos = 0;
            ll sum = 0;
            for (int i = lg(n); ~i; i--){
                int j = (1<<i);
                if (pos + j <= n && f(x - 2 * (sum + tree[pos+j]))){
                    pos += j; sum += tree[pos];
                }
            }
            return pos-1;
        }
        void update(int pos, ll x){
            pos++;
            if (pos < 1) return;
            for (; pos <= n; pos += (pos & (-pos)))
                tree[pos] += x;
        }
    };

    struct sparse{

        vector<vector<int> > lookup;
        void Construct(int n, int* a){
            lookup.assign(n, vector<int>(lg(n)+1, INF));
            for (int i = 0; i < n; i++)
                lookup[i][0] = a[i];
            for (int d = 1; d <= lg(n); d++)
                for (int i = 0; i < n; i++)
                    if (i + (1<<d) <= n)
                        lookup[i][d] = min(lookup[i][d-1], lookup[i+(1<<(d-1))][d-1]);
        }
        int query(int l, int r) const {
            int d = highpow(r-l+1);
            return min(lookup[l][lg(d)], lookup[r-d+1][lg(d)]);
        }
    };

    ll sum = 0;
    int in[mxN], _in[mxN];
    BIT fen;
    sparse table;

    void Euler(int s, int p, int t){
        in[s] = t;
        _in[t] = s;
        for (int u : g[s])
            if (u^p) Euler(u, s, t+1);
    }

    int Calc(){
        int i = fen.walk(sum, [](ll x){ return x > 0; });
        if (i < n-1) i++;
        int j = fen.walk(sum, [](ll x){ return x >= 0; });
        if (j < n-1) j++;
        return table.query(i, j);
    }

    void Solve(){
        int s = 0;
        for (int i = 0; i < n; i++)
            if (g[i].size() == 1) s = i;
        Euler(s, -1, 0);
        fen.Assign(n);
        for (int i = 0; i < n; i++){
            sum += a[_in[i]];
            fen.update(i, a[_in[i]]);
        }
        table.Construct(n, _in);
        cout << Calc()+1 << en;
        while (m--){
            rl(x); ri(i); i--;
            i = in[i];
            fen.update(i, x);
            sum += x;
            cout << Calc()+1 << en;
        }
    }
}

namespace Binary{

    ll sum[mxN], par[mxN], sz[mxN], root;

    int Size(int s = 0, int p = -1){
        for (int u : g[s])
            if (u^p) sz[s] += Size(u, s);
        return ++sz[s];
    }

    int Root(int s = 0, int p = -1){
        for (int u : g[s])
            if (u^p && 2*sz[u] > n)
                return Root(u, s);
        return s;
    }

    void init(int s, int p = -1){
        par[s] = p;
        sum[s] = a[s];
        for (int i = 0; i < g[s].size(); i++)
            if (g[s][i] == p) g[s].erase(g[s].begin() + i);
        for (int u : g[s]){
            init(u, s);
            sum[s] += sum[u];
        }
    }

    void update(int s, ll x){
        sum[s] += x;
        if (~par[s]) update(par[s], x);
    }

    int query(int s){
        for (int u : g[s]){
            if (2*sum[u] > sum[root])
                return query(u);
            if (2*sum[u] == sum[root])
                return min(s, u);
        }
        return s;
    }

    void Solve(){
        Size();
        root = Root();
        init(root);
        cout << query(root)+1 << en;
        while (m--){
            rl(x); ri(s); s--;
            update(s, x);
            cout << query(root)+1 << en;
        }
    }
}

namespace Centroid{

    int root, sz[mxN], mp[mxN], dep[mxN], par[mxN];
    ll sum[mxN];
    vector<int> G[mxN], came[mxN];
    bool was[mxN];

    int Size(int s, int p = -1){
        sz[s] = 1;
        for (int u : g[s])
            if (u^p && !was[u])
                sz[s] += Size(u, s);
        return sz[s];
    }

    int Root(int s, int p, int n){

        for (int u : g[s])
            if (u^p && !was[u] && 2*sz[u] > n)
                return Root(u, s, n);
        return s;
    }

    int Decomp(int s = 0, int p = -1){
        int n = Size(s);
        int c = Root(s, -1, n);
        mp[c] = (~p ? s : c);
        was[c] = 1;
        for (int u : g[c]){
            if (!was[u]){
                came[c].pb(u);
                G[c].pb(Decomp(u, s));
            }
        }
        return c;
    }

    void Depth(int s, int p = -1, int d = 0){

        dep[s] = d;
        for (int u : g[s])
            if (u^p) Depth(u, s, d+1);
    }

    void init(int s, int p = -1){

        par[s] = p;
        sum[s] = a[s];
        for (int u : G[s]){
            init(u, s);
            sum[s] += sum[u];
        }
    }

    void update(int s, ll x){

        sum[s] += x;
        if (~par[s]) update(par[s], x);
    }

    int query(int s, ll pre = 0){

        for (int i = 0; i < G[s].size(); i++){
            int u = G[s][i];
            ll cur = sum[root];
            if (dep[came[s][i]] < dep[s]) cur = 2*max(sum[s], pre) - cur;
            if (2*sum[u] > cur) return query(u, (cur^sum[root] ? sum[s] : 0));
            if (2*sum[u] == cur) return min(s, mp[u]);
        }
        return s;
    }

    void Solve(){

        root = Decomp();
        Depth(root);
        init(root);
        cout << query(root)+1 << en;
        while (m--){
            rl(x); ri(s); s--;
            update(s, x);
            cout << query(root)+1 << en;
        }
    }
}

int Depth(int s, int p = -1){
    int d = 0;
    for (int u : g[s])
        if (u^p)
            smax(d, Depth(u, s));
    return d+1;
}

int sz[mxN];

int Size(int s = 0, int p = -1){
    for (int u : g[s])
        if (u^p) sz[s] += Size(u, s);
    return ++sz[s];
}

int Root(int s = 0, int p = -1){
    for (int u : g[s])
        if (u^p && 2*sz[u] > n)
            return Root(u, s);
    return s;
}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0); cerr.tie(0);
    cout << setprecision(12) << fixed;
    cerr << setprecision(12) << fixed;
    cerr << "Started!" << endl;

    cin >> n;
    bool f = 1;
    for (int i = 0; i < n-1; i++){
        ri(u); ri(v);
        u--; v--;
        g[u].pb(v);
        g[v].pb(u);
        if (max(g[u].size(), g[v].size()) > 2) f = 0;
    }
    for (int i = 0; i < n; i++)
        cin >> a[i];
    cin >> m;
    Size();
    if (!m) Brute::Solve();
    else if (f) Chain::Solve();
    else if (Depth(Root()) <= 2*lg(n)) Binary::Solve();
    else Centroid::Solve();

    return 0;
}