#include<bits/stdc++.h>
using namespace std;
int n,q;
vector<int>G[100005];
int main()
{
	freopen("query.in","r",stdin);
	freopen("query.out","w",stdout);
	cin>>n>>q;
	for(int i=1;i<n;i++)
	{
		int u,v;
		cin>>u>>v;
		G[u].push_back(v);
	}
	for(int i=1;i<=q;i++)
	{
		int l,r,k;
		cin>>l>>r>>k;
		cout<<G[l][0]+G[r][0]-k<<endl;
	}
	return 0;
}
