#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 2e5 + 2;
const int inf = 2e9;
vector<int> g[N];
ll a[N], uk;
int par[N][18], in[N], out[N], tsz;
void Dfs(int s, int e) {
    in[s] = tsz++;
    par[s][0] = e;
    for (int i = 1; i < 18; i++) par[s][i] = par[par[s][i - 1]][i - 1];
    for (int u : g[s]) if (u != e) {
        Dfs(u, s);
        a[s] += a[u];
    }
    out[s] = tsz++;
}
bool Ancestor(int u, int v) {
    return in[u] <= in[v] && out[v] <= out[u];
}
int Lca(int u, int v) {
    if (Ancestor(u, v)) return u;
    if (Ancestor(v, u)) return v;
    for (int i = 17; i >= 0; i--) {
        if (par[u][i] && !Ancestor(par[u][i], v)) u = par[u][i];
    }
    return par[u][0];
}
int Dfsq0(int s, int e) {
    for (int u : g[s]) {
        if (u == e) continue;
        if (a[u] >= (uk + 1) / 2) return Dfsq0(u, s);
    }
    return s;
}
void RollBack(int s, int e) {
    for (int u : g[s]) {
        if (u == e) continue;
        a[s] -= a[u];
        RollBack(u, s);
    }
}
vector<int> v3;
int inv[N];
void Dfs3(int s, int e) {
    v3.push_back(s);
    for (int u : g[s]) {
        if (u == e) continue;
        Dfs3(u, s);
        a[s] += a[u];
    }
}
ll st[4 * N], lzy[4 * N];
void Init(int node, int l, int r) {
    if (l == r) {
        st[node] = inv[a[l]];
        lzy[node] = 0;
        return;
    }
    int mid = l + r >> 1;
    Init(2 * node, l, mid);
    Init(2 * node + 1, mid + 1, r);
    st[node] = max(st[2 * node], st[2 * node + 1]);
    lzy[node] = 0;
}
void Propagate(int node, int l, int r) {
    if (lzy[node] == 0) return;
    if (l < r) {
        lzy[2 * node] += lzy[node];
        lzy[2 * node + 1] += lzy[node];
    }
    st[node] += lzy[node];
    lzy[node] = 0;
}
void Update(int node, int l, int r, int ql, int qr, int x) {
    Propagate(node, l, r);
    if (r < ql || qr < l) return;
    if (ql <= l && r <= qr) {
        lzy[node] += x;
        Propagate(node, l, r);
        return;
    }
    int mid = l + r >> 1;
    Update(2 * node, l, mid, ql, qr, x);
    Update(2 * node + 1, mid + 1, r, ql, qr, x);
    st[node] = max(st[2 * node], st[2 * node + 1]);
}
pair<int, ll> Get(int node, int l, int r, ll v) {
    if (l == r) return {l, st[node]};
    int mid = l + r >> 1;
    if (st[2 * node + 1] >= v) return Get(2 * node + 1, mid + 1, r, v);
    return Get(2 * node, l, mid, v);
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n; cin >> n;
    for (int i = 0; i < n - 1; i++) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        uk += a[i];
    }
    Dfs(1, 0);
    int q; cin >> q;
    if (q == 0) {
        int x = Dfsq0(1, 0);
        if (uk % 2 == 0 && a[x] == uk / 2) smin(x, par[x][0]);
        cout << x << en;
        return 0;
    }
    RollBack(1, 0);
    int mxadj = 1;
    for (int i = 1; i <= n; i++) if (g[i].size() > g[mxadj].size()) mxadj = i;
    if (g[mxadj].size() <= 2) {
        int root = 1;
        for (int i = 1; i <= n; i++) if (g[i].size() == 1) root = i;
        Dfs3(root, 0);
        for (int i = 0; i < n; i++) inv[v3[i]] = i;
        Init(1, 0, n - 1);
        auto Nadji = [&] () {
            auto x = Get(1, 0, n - 1, (uk + 1) / 2);
            if (uk % 2 == 0 && x.second == uk / 2) return min(v3[x.first - 1], v3[x.first]);
            return v3[x.first];
        };
        cout << Nadji() << en;
        while (q--) {
            int z, b;
            cin >> z >> b;
            uk += z;
            Update(1, 0, n - 1, 1, inv[b], z);
            cout << Nadji() << en;
        }
        return 0;
    }
    int Counter = 0;
    int who = 1;
    for (int i = 1; i <= n; i++) if (g[i].size() == 2) Counter++, who = i;
    if (Counter == 1) {
        vector<int> parent(n + 1);
        function<void(int, int)> Dfs4 = [&] (int s, int e) {
            parent[s] = e;
            for (int u : g[s]) {
                if (u == e) continue;
                Dfs4(u, s);
                a[s] += a[u];
            }
        };
        function<void(int, int)> Change = [&] (int s, int x) {
            uk += x;
            while (s > 0) {
                a[s] += x;
                s = parent[s];
            }
        };
        function<int(int, int, ll)> Nadji2 = [&] (int s, int e, ll v) {
            for (int u : g[s]) {
                if (u == e) continue;
                if (a[u] >= v) return Nadji2(u, s, v);
            }
            return s;
        };
        auto Ispisi = [&] () {
            int y = Nadji2(who, 0, (uk + 1) / 2);
            if (uk % 2 == 0 && a[y] == uk / 2) return min(parent[y], y);
            return y;
        };
        Dfs4(who, 0);
        cout << Ispisi() << en;
        while (q--) {
            int z, b;
            cin >> z >> b;
            Change(b, z);
            cout << Ispisi() << en;
        }
        return 0;
    }
    return 0;
}