#include <bits/stdc++.h>
#define N 200005
using namespace std;

vector<int> adj[N];

long long sum(int i, vector <bool>& visited, vector <long long> &a)
{
	visited[i] = true;
	long long s = 0;
	for (auto j : adj[i])
	{
		if (!visited[j])
		{
			long long x = sum(j, visited, a);
			s += a[j] + x;
			a[i] += a[j];
		}
	}
	return s;
}

void solve(vector <long long> a)
{
	int n = a.size();
	int imin;
	long long xmin;
	for (int i = 0; i < n; i++)
	{
		vector<bool> visited(n, false);
		vector<long long> b = a;
		long long x = sum(i, visited, b);
		if (i == 0 || x < xmin)
		{
			imin = i;
			xmin = x;
		}
	}
	cout << imin + 1 << endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long long n, q, x, y;
	cin >> n;
	vector<long long>a(n);
	for (int i = 0; i < n - 1; i++)
	{
		cin >> x >> y;
		x--, y--;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	for (int i = 0; i < n; i++)
		cin >> a[i];
	solve(a);
	cin >> q;
	vector<long long>b(q), z(q);
	for (int i = 0; i < q; i++)
	{
		cin >> z[i] >> b[i];
		a[b[i] - 1] += z[i];
		solve(a);
	}
}