#include<bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, p, m, cnt, tot = 1, Time;
struct E {
int nxt, to;
} e[N << 1];
struct P {
int x1, y1, x2, y2, w, id, k, type;
P(int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0, int w = 0, int id = 0, int k = 0, int type = 0) : x1(x1), y1(y1), x2(x2), y2(y2), w(w), id(id), k(k), type(type) {}
} event[N], q[N];
struct BIT {
int tree[N];
int lowbit(int x) {return x&(-x);}
void update(int l, int r, int v)
{
for(int i = l; i <= n; i += lowbit(i)) tree[i] += v;
for(int i = r + 1; i <= n; i += lowbit(i)) tree[i] -= v;
}
int query(int pos) {int ret = 0; for(int i = pos; i; i -= lowbit(i)) ret += tree[i]; return ret;}
} t;
vector<P> c, lp, rp;
int head[N], ans[N], low[N], dfn[N] ,fa[23][N], dep[N];
void link(int u, int v)
{
e[++tot].nxt = head[u];
head[u] = tot;
e[tot].to = v;
}
bool cp(P i, P j) {return i.w < j.w;}
bool cp1(P i, P j) {return i.x1 == j.x1 ? i.type < j.type : i.x1 < j.x1;}
void dfs(int u, int last)
{
dfn[u] = ++Time;
for(int i = head[u]; i; i = e[i].nxt) if(e[i].to != last)
{
fa[0][e[i].to] = u;
dep[e[i].to] = dep[u] + 1;
dfs(e[i].to, u);
}
low[u] = Time;
}
int lca(int u, int v)
{
if(dep[u] < dep[v]) swap(u, v);
for(int i = 22; i >= 0; --i) if((dep[u] - dep[v]) & (1 << i))
u = fa[i][u];
if(u == v) return u;
for(int i = 22; i >= 0; --i) if(fa[i][u] != fa[i][v])
{
u = fa[i][u]; v = fa[i][v];
}
return fa[0][u];
}
int jump(int u, int h)
{
for(int i = 22; i >= 0; --i) if(h & (1 << i)) u = fa[i][u]; return u;
}
void solve(int l, int r, int lb, int rb)
{
if(l > r) return;
if(lb == rb)
{
for(int i = l; i <= r; ++i) ans[q[i].id] = event[lb].w;
return;
}
int mb = (lb + rb) >> 1;
c.clear(); lp.clear(); rp.clear();
for(int i = lb; i <= mb; ++i)
{//盘子
P x = event[i];
// printf("x1=%d x2=%d\n", x.x1, x.x2);
x.w = 1; x.type = 0;
c.push_back(x); x.type = 2;
x.w = -1; x.x1 = event[i].x2;
c.push_back(x);
}
for(int i = l; i <= r; ++i)
{//水果
c.push_back(q[i]);
}
sort(c.begin(), c.end(), cp1);
for(int i = 0; i < c.size(); ++i)
{
if(c[i].type != 1)
{
// printf("x=%d y1=%d y2=%d\n", c[i].x1, c[i].y1, c[i].y2);
t.update(c[i].y1, c[i].y2, c[i].w);
}
else
{
int sum = t.query(c[i].y1);
// printf("sum=%d k=%d\n", sum, c[i].k);
if(sum >= c[i].k) lp.push_back(c[i]);
else {c[i].k -= sum; rp.push_back(c[i]);}
}
}
for(int i = 0; i < c.size(); ++i) if(c[i].type != 1)
t.update(c[i].y1, c[i].y2, -c[i].w);
for(int i = 0; i < lp.size(); ++i) q[l + i] = lp[i];
for(int i = 0; i < rp.size(); ++i) q[l + lp.size() + i] = rp[i];
int mid = l + lp.size() - 1;
solve(l, mid, lb, mb); solve(mid + 1, r, mb + 1, rb);
}
int main()
{
freopen("fruit_hnoi2015.in", "r", stdin);
freopen("fruit_hnoi2015.out", "w", stdout);
scanf("%d%d%d",&n,&p,&m);
for(int i = 1; i < n; ++i)
{
int u, v; scanf("%d%d",&u,&v);
link(u, v); link(v, u);
}
memset(fa, -1, sizeof(fa));
dfs(1, 0);
for(int i = 1; i <= 22; ++i)
for(int j = 1; j <= n; ++j) if(fa[i-1][j] != -1)
fa[i][j] = fa[i-1][fa[i-1][j]];
for(int i = 1; i <= p; ++i)
{
int u, v, w; scanf("%d%d%d", &u, &v, &w);
int x = lca(u, v);
if(dfn[u] > dfn[v]) swap(u, v);
if(u != x)
{
event[++cnt].x1 = dfn[u]; event[cnt].y1 = dfn[v];
event[cnt].x2 = low[u]; event[cnt].y2 = low[v];
event[cnt].w = w;
}
else
{
int t = jump(v, dep[v] - dep[u] - 1);
event[++cnt].x1 = 1; event[cnt].y1 = dfn[v];
event[cnt].x2 = dfn[t] - 1; event[cnt].y2 = low[v];
event[cnt].w = w;
if(low[t] < n)
{
event[++cnt].x1 = dfn[v]; event[cnt].y1 = low[t] + 1;
event[cnt].x2 = low[v]; event[cnt].y2 = n;
event[cnt].w = w;
}
}
}
for(int i = 1; i <= m; ++i)
{
int u, v;
scanf("%d%d%d", &u, &v, &q[i].k);
if(dfn[u] > dfn[v]) swap(u, v);
q[i].x1 = dfn[u]; q[i].y1 = dfn[v];
q[i].id = i; q[i].type = 1;
}
sort(event + 1, event + cnt + 1, cp);
solve(1, m, 1, cnt);
for(int i = 1; i <= m; ++i) printf("%d\n", ans[i]);
fclose(stdin); fclose(stdout);
return 0;
}