#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;

const int N = 10005;
int n,m,q,a[N];
int f[N][20];
int dth[N];
vector<int> vec[N];

inline void dfs(int x,int fa){
	dth[x] = dth[fa]+1;
	for(int v:vec[x]){
		if(v==fa) continue;
		dfs(v,x); 
	}
}
inline void solve1(int l,int r,int k){
	
}

signed main(){
	ios::sync_with_stdio(false);
	freopen("query.in","r",stdin);
	freopen("query.out","w",stdout);
	cin>>n;
	int q1,q2;
	for(int i=1;i<n;i++){
		cin>>q1>>q2;
		vec[q1].push_back(q2);
		vec[q2].push_back(q1);
	}
	bool flag = 1;
	int cnt = 0;
	for(int i=1;i<=n;i++){
		if(vec[i].size()>2){
			flag = 0;
			break;
		}
		if(vec[i].size()==2){
			cnt++;
		}
	} 
	if(cnt!=2) flag = 0; 
	dfs(1,0);
	cin>>q;
	int l,r,k;
	for(int i=1;i<=q;i++){
		cin>>l>>r>>k;
		if(flag){
			solve1(l,r,k);
		}
	}
	
	return 0;
}
