#include "cstdio"
#include "cmath"

int findMax(int weights[],int n)
{
    int x = 0;int m = 0;
    for(int i = 0; i < n;i++)
    {
        if(weights[i] > x) {m=i;x=weights[i];}
    }
    return m;
}

void solve(int weights[],int n)
{
    int goal = findMax(weights,n);
    printf("%d",goal+1);
}


int main() {
    int n;
    scanf("%d", &n);
    int weights[n] = {0};
    int gold[n] = {0};
    int depth[n] = {0};
    int max = 0;
    for (int i = 0; i < n - 1; i++) {
        int x, y;
        scanf("%d %d", &x, &y);
        weights[x - 1] += 1;
        weights[y - 1] += 1;
        depth[x-1] = weights[x-1] == 0 ? fmax(0,depth[y-1]-1) : depth[x-1];
        depth[y-1] = depth[x-1]+1;
        if(depth[x-1] > max) max = depth[x-1];
        if(depth[y-1] > max) max = depth[y-1];
    }
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        weights[i] += x;
        gold[i] += x;
    }
    for(int i = 0; i <n-1;i++)
    {
        weights[i] += fmin(max - depth[i],depth[i]);
    }
    solve(weights,n);
    int q;
    scanf("%d",&q);
    for(int i = 0; i < q;i++)
    {
        int x,y;
        scanf("%d %d", &x,&y);
        weights[y-1] += x;
        gold[y-1] += x;
        printf("\n");
        solve(weights,n);
    }
}