#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll N,niz[200005],u1,u2;
vector<int> stablo[200005];
ll nadji(int gde,int pret,int dub){
	ll ret=dub*niz[gde];
	for(int i=0;i<stablo[gde].size();i++){
		if(stablo[gde][i]==pret)
			continue;
		ret+=nadji(stablo[gde][i],gde,dub+1);
	}
	return ret;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin>>N;
	for(int i=1;i<N;i++){
		cin>>u1>>u2;
		stablo[u1].push_back(u2);
		stablo[u2].push_back(u1);
	}
	for(int i=1;i<=N;i++)
		cin>>niz[i];
	for(int i=1;i<=N;i++){
		cout<<i<<": "<<nadji(i,0,0)<<endl;
	}
	while(true){
		int a,b;
		cin>>a>>b;
		niz[a]+=b;
		for(int i=1;i<=N;i++){
			cout<<i<<": "<<nadji(i,0,0)<<endl;
		}
	}
	return 0;
}
/*
9
1 2
2 3
3 4
4 5
5 6
3 7
7 8
8 9
0 0 0 0 0 0 0 0 0
*/