#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <iostream>
#include <math.h>
#include <iterator>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <string.h>
#include <cstring>
#include <queue>
#include <iomanip>
#include <istream>
#include <map>
#include <list>
#include <stack>
#include <numeric>
#include <ostream>
#include <set>
#include <cassert>
#include <sstream>
#include <string>
#include <utility>
#include <stdio.h>
#include <vector>
using namespace std;
#define dout if (debug) cout
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) (int((x.size())))
typedef long double ld;
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<PII> VPI;
#define REP(i,a,n) for (int i=a;i<n;i++)
#define db(x) cerr << #x << " = " << x << endl
#define PER(i,a,n) for (int i=n-1;i>=a;i--)
const int INF = 1000000404;
const ll MOD = 1000000007ll;
const ld PI = acos(-1.0);
const ld EPS = 1e-9;
template <typename t1, typename t2> inline void upmax(t1 &a, t2 b) { a = max(a, (t1)b); }
template <typename t1, typename t2> inline void upmin(t1 &a, t2 b) { a = min(a, (t1)b); }
template <typename T>inline T gcd(T a, T b) { return b ? gcd(b, a%b) : a; }
template <typename T>inline T lcm(T a, T b) { return a*(b / gcd(a, b)); }
template <typename T>inline T sqr(T a) { return a*a; }
template <typename T>inline bool pal(T &x)
{
	int n = SZ(x); REP(i, 0, n / 2) { if (x[i] != x[n - i - 1]) return 0; }return 1;
}
template <typename T>inline void rev(T &x) { int n = SZ(x); REP(i, 0, n / 2) swap(x[i], x[n - i - 1]); }
int month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };
inline ll mp(ll a, ll b) { return (a << 31) + b; }
class compare{
public:
	bool operator()(const int a, const int b) const {
		return 1;
	}
};
int SQ = 400;

#define debug 1
#define N 111111
int tin[N];
int tout[N];
int up[N][20];
int h[N];
int ar[N];
VI g[N];
VI t[N][20];
int c[N];
int timer, L;

VI merge(VI &a, VI &b) {
	VI c;
	auto x = a.begin();
	auto y = b.begin();

	while ((x != a.end() && y != b.end()) && SZ(c) < 10) {
		if (*x < *y) {
			c.push_back(*x); x++;
		}
		else {
			if (*x == *y) x++;
			c.push_back(*y);
			y++;
		}
	}
	while (x != a.end() && SZ(c)<10) {
		c.push_back(*x); x++;
	}
	while (y != b.end() && SZ(c)<10) {
		c.push_back(*y); y++;
	}
	return c;
}
void vmerge(VI &a, VI &b, VI &c) {

	auto x = a.begin();
	auto y = b.begin();

	while ((x != a.end() && y != b.end()) && SZ(c) < 10) {
		if (*x < *y) {
			c.push_back(*x); x++;
		}
		else {
			if (*x == *y) x++;
			c.push_back(*y);
			y++;
		}
	}
	while (x != a.end() && SZ(c)<10) {
		c.push_back(*x); x++;
	}
	while (y != b.end()&&SZ(c)<10) {
		c.push_back(*y); y++;
	}

}

bool upper(int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

void DFS(int v, int p) {
	tin[v] = ++timer;
	up[v][0] = p;
	h[v] = h[p] + 1;
	sort(ALL(t[v][0]));
	t[v][0].resize(min(SZ(t[v][0]), 10));
	REP(i, 1, L) {
		up[v][i] = up[up[v][i - 1]][i - 1];
		vmerge(t[v][i - 1], t[up[v][i - 1]][i - 1], t[v][i]);
	}
	for (auto x : g[v]) {
		if (x != p) DFS(x, v);
	}
	tout[v] = ++timer;
}

int LCA(int a, int b) {
	if (upper(a, b)) return a;
	if (upper(b, a)) return b;
	PER(i, 0, L) {
		if (!upper(up[a][i], b)) a = up[a][i];
	}
	return up[a][0];
}
void under(int a, int b, VI &ret) {

	PER(i, 0, L){
		if (h[up[a][i]] >= h[b] && a != up[a][i]) {
			ret = merge(ret, t[a][i]);
			a = up[a][i];
		}
	}

}
void print(VI &v) {
	cout << "P:" << endl;
	for (auto x : v) cout << x << ' '; cout << endl;
}
void solve()
{
	int n, m, q;
	cin >> n >> m >> q;
	REP(i, 2, n + 1) {
		int a, b;
		scanf("%d%d", &a, &b);
		g[a].push_back(b);
		g[b].push_back(a);
	}
	L = 20;

	REP(i, 1, m + 1) {
		scanf("%d", c + i);
		t[c[i]][0].push_back(i);
	}
	DFS(1, 1);
	REP(i, 0, q) {
		int u, v, x;
		scanf("%d%d%d", &u, &v, &x);
		int lca = LCA(u, v);
		VI a = t[lca][0];
		under(u, lca, a);
		under(v, lca, a);

		printf("%d ", min(x, SZ(a)));
		REP(i, 0, min(x, SZ(a))) printf("%d ", a[i]); printf("\n");
	}

}

int main()
{
	//freopen("codeforces.in", "r", stdin);
	//freopen("codeforces.out", "w", stdout);
	int t = 1;
	//cin>>t;

	while (t--) {
		solve();
	};

	getchar();
	getchar();
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 16;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e) {
//		st[node] = arr[s];
		sort(arr[s].begin(), arr[s].end());
		for (int i = 0; i < min(10, (int) arr[s].size()); i++)
			st[node].push_back(arr[s][i]);
	} else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int> v;
		int i, j;
		for (i = 0, j = 0;
				i < (int) st[node << 1].size()
						&& j < (int) st[node << 1 | 1].size() && i + j < 10;)
			if (st[node << 1][i] < st[node << 1 | 1][j])
				st[node].push_back(st[node << 1][i++]);
			else
				st[node].push_back(st[node << 1 | 1][j++]);
		while (i < (int) st[node << 1].size() && i + j < 10)
			st[node].push_back(st[node << 1][i++]);
		while (j < (int) st[node << 1 | 1].size() && i + j < 10)
			st[node].push_back(st[node << 1 | 1][j++]);
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	int i, j;
	for (i = 0, j = 0;
			i < (int) left.size() && j < (int) right.size() && i + j < 10;)
		if (left[i] < right[j])
			v.push_back(left[i++]);
		else
			v.push_back(right[j++]);
	while (i < (int) left.size() && i + j < 10)
		v.push_back(left[i++]);
	while (j < (int) right.size() && i + j < 10)
		v.push_back(right[j++]);
	return v;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca], posInArr[v]);
			for (int i = 0; i < min((int) here.size(), 10); i++)
				res.insert(here[i]);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (int i = 0; i < min((int) here.size(), 10); i++)
			res.insert(here[i]);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {

	scanf("%d%d%d", &n, &m, &q);
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		printf("%d", k);
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			printf(" %d", x);
			num++;
		}
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 17;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e)
		st[node] = arr[s];
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int> v;
		int idx = 0;
		for (auto x : st[node << 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		idx = 0;
		for (auto x : st[node << 1 | 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		sort(v.begin(), v.end());
		vector<int> res;
		for (int i = 0; i < min(10, (int) v.size()); i++)
			res.push_back(v[i]);
		st[node] = res;
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	for (auto x : left)
		v.push_back(x);
	for (auto x : right)
		v.push_back(x);
	sort(v.begin(), v.end());
	vector<int> ss;
	for (int i = 0; i < min((int) v.size(), 10); i++)
		ss.push_back(v[i]);
	return ss;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca], posInArr[v]);
			for (auto x : here)
				res.insert(x);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (auto x : here)
			res.insert(x);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> q;
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		cout << k;
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			cout << " " << x;
			num++;
		}
		cout << "\n";
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int n_=1e5+10,LOG=17;
int n,m,q;
vector<int>tree[n_];
int lvl[n_],parentLog[n_][LOG+1];
vector<int>residents[n_],resLog[n_][LOG+1];
void dfs(int node=0,int p=-1){
	parentLog[node][0]=p;
	for(int i=0;i<(int)tree[node].size();i++){
		int child=tree[node][i];
		if(child!=p){
			lvl[child]=lvl[node]+1;
			dfs(child,node);
		}
	}
}

int LCA(int u,int v){
	if(lvl[u]<lvl[v])
		swap(u,v);
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[v])
			u=parentLog[u][log];
	if(u==v)return u;
	for(int log=LOG;log>=0;log--)
		if(parentLog[u][log]!=-1&&parentLog[u][log]!=parentLog[v][log])
			u=parentLog[u][log],v=parentLog[v][log];
	return parentLog[u][0];
}

vector<int>query(int u,int lca){
	if(u==lca)return residents[u];
	vector<int>res;
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[lca]){
			for(int i=0;i<(int)resLog[u][log].size();i++)
				res.push_back(resLog[u][log][i]);
			u=parentLog[u][log];
		}
	for(int i=0;i<(int)residents[u].size();i++)
		res.push_back(residents[u][i]);
	return res;
}
int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin>>n>>m>>q;
	for(int i=0;i<n-1;i++){
		int u,v;
		cin>>u>>v;
		u--,v--;
		tree[u].push_back(v);
		tree[v].push_back(u);
	}
	memset(parentLog,-1,sizeof parentLog);
	dfs();
	for(int log=1;log<=LOG;log++)
		for(int i=0;i<n;i++)
			if(parentLog[i][log-1]!=-1)
				parentLog[i][log]=parentLog[parentLog[i][log-1]][log-1];
	for(int i=0;i<m;i++){
		int c;
		cin>>c;
		c--;
		residents[c].push_back(i+1);
	}
	for(int i=0;i<n;i++)
		sort(residents[i].begin(),residents[i].end());
	resLog[0][0]=residents[0];
	for(int i=1;i<n;i++){
		int x,y;
		for(x=0,y=0;x<(int)residents[parentLog[i][0]].size()&&y<(int)residents[i].size()&&x+y<10;)
			if(residents[parentLog[i][0]][x]<residents[i][y])
				resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
			else
				resLog[i][0].push_back(residents[i][y++]);
		while(x+y<10&&x<(int)residents[parentLog[i][0]].size())
			resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
		while(x+y<10&&y<(int)residents[i].size())
			resLog[i][0].push_back(residents[i][y++]);
	}

	for(int log=1;log<=LOG;log++){
		for(int i=0;i<n;i++){
			if(parentLog[i][log-1]==-1)continue;
			int x,y;
			for(x=0,y=0;x<(int)resLog[i][log-1].size()&&y<(int)resLog[parentLog[i][log-1]][log-1].size()&&x+y<10;)
				if(resLog[i][log-1][x]<resLog[parentLog[i][log-1]][log-1][y])
					resLog[i][log].push_back(resLog[i][log-1][x++]);
				else
					resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
			while(x+y<10&&x<(int)resLog[i][log-1].size())
				resLog[i][log].push_back(resLog[i][log-1][x++]);
			while(x+y<10&&y<(int)resLog[parentLog[i][log-1]][log-1].size())
				resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
		}
	}

	while(q--){
		int u,v,a;
		cin>>u>>v>>a;
		u--,v--;
		int lca=LCA(u,v);
		vector<int>v1=query(u,lca),v2=query(v,lca);
		sort(v1.begin(),v1.end());
		sort(v2.begin(),v2.end());
		int x,y;
		set<int>st;
		for(x=0,y=0;(int)st.size()<a&&x<(int)v1.size()&&y<(int)v2.size();)
			if(v1[x]<v2[y])
				st.insert(v1[x++]);
			else
				st.insert(v2[y++]);
		while((int)st.size()<a&&x<(int)v1.size())
			st.insert(v1[x++]);
		while((int)st.size()<a&&y<(int)v2.size())
			st.insert(v2[y++]);
		cout<<(int)st.size();
		for(set<int>::iterator it=st.begin();it!=st.end();it++)
			cout<<" "<<*it;
		cout<<"\n";
	}
}


#include<bits/stdc++.h>

using namespace std;

const int n_=1e5+10,LOG=17;
int n,m,q;
vector<int>tree[n_];
int lvl[n_],parentLog[n_][LOG+1];
vector<int>residents[n_],resLog[n_][LOG+1];
void dfs(int node=0,int p=-1){
	parentLog[node][0]=p;
	for(int i=0;i<(int)tree[node].size();i++){
		int child=tree[node][i];
		if(child!=p){
			lvl[child]=lvl[node]+1;
			dfs(child,node);
		}
	}
}

int LCA(int u,int v){
	if(lvl[u]<lvl[v])
		swap(u,v);
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[v])
			u=parentLog[u][log];
	if(u==v)return u;
	for(int log=LOG;log>=0;log--)
		if(parentLog[u][log]!=-1&&parentLog[u][log]!=parentLog[v][log])
			u=parentLog[u][log],v=parentLog[v][log];
	return parentLog[u][0];
}

vector<int>query(int u,int lca){
	vector<int>res;
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[lca]){
			for(int i=0;i<(int)resLog[u][log].size();i++)
				res.push_back(resLog[u][log][i]);
			u=parentLog[u][log];
		}
	for(int i=0;i<(int)residents[u].size();i++)
		res.push_back(residents[u][i]);
	return res;
}
int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin>>n>>m>>q;
	for(int i=0;i<n-1;i++){
		int u,v;
		cin>>u>>v;
		u--,v--;
		tree[u].push_back(v);
		tree[v].push_back(u);
	}
	memset(parentLog,-1,sizeof parentLog);
	dfs();
	for(int log=1;log<=LOG;log++)
		for(int i=0;i<n;i++)
			if(parentLog[i][log-1]!=-1)
				parentLog[i][log]=parentLog[parentLog[i][log-1]][log-1];
	for(int i=0;i<m;i++){
		int c;
		cin>>c;
		c--;
		residents[c].push_back(i+1);
	}
	for(int i=0;i<n;i++)
		sort(residents[i].begin(),residents[i].end());
	resLog[0][0]=residents[0];
	for(int i=1;i<n;i++){
		int x,y;
		for(x=0,y=0;x<(int)residents[parentLog[i][0]].size()&&y<(int)residents[i].size()&&x+y<10;)
			if(residents[parentLog[i][0]][x]<residents[i][y])
				resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
			else
				resLog[i][0].push_back(residents[i][y++]);
		while(x+y<10&&x<(int)residents[parentLog[i][0]].size())
			resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
		while(x+y<10&&y<(int)residents[i].size())
			resLog[i][0].push_back(residents[i][y++]);
	}

	for(int log=1;log<=LOG;log++){
		for(int i=0;i<n;i++){
			if(parentLog[i][log-1]==-1)continue;
			int x,y;
			set<int>taken;
			for(x=0,y=0;x<(int)resLog[i][log-1].size()&&y<(int)resLog[parentLog[i][log-1]][log-1].size()&&(int)taken.size()<10;)
				if(resLog[i][log-1][x]<resLog[parentLog[i][log-1]][log-1][y])
					taken.insert(resLog[i][log-1][x]),resLog[i][log].push_back(resLog[i][log-1][x++]);
				else
					taken.insert(resLog[parentLog[i][log-1]][log-1][y]),resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
			while((int)taken.size()<10&&x<(int)resLog[i][log-1].size())
				taken.insert(resLog[i][log-1][x]),resLog[i][log].push_back(resLog[i][log-1][x++]);
			while((int)taken.size()<10&&y<(int)resLog[parentLog[i][log-1]][log-1].size())
				taken.insert(resLog[parentLog[i][log-1]][log-1][y]),resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
		}
	}

	while(q--){
		int u,v,a;
		cin>>u>>v>>a;
		u--,v--;
		int lca=LCA(u,v);
		vector<int>v1=query(u,lca),v2=query(v,lca);
		sort(v1.begin(),v1.end());
		sort(v2.begin(),v2.end());
		int x,y;
		set<int>st;
		for(x=0,y=0;(int)st.size()<a&&x<(int)v1.size()&&y<(int)v2.size();)
			if(v1[x]<v2[y])
				st.insert(v1[x++]);
			else
				st.insert(v2[y++]);
		while((int)st.size()<a&&x<(int)v1.size())
			st.insert(v1[x++]);
		while((int)st.size()<a&&y<(int)v2.size())
			st.insert(v2[y++]);
		cout<<(int)st.size();
		for(set<int>::iterator it=st.begin();it!=st.end();it++)
			cout<<" "<<*it;
		cout<<"\n";
	}
}


#include<bits/stdc++.h>

using namespace std;

const int n_=1e5+10,LOG=16;
int n,m,q;
vector<int>tree[n_];
int lvl[n_],parentLog[n_][LOG+1];
vector<int>residents[n_],resLog[n_][LOG+1];
void dfs(int node=0,int p=-1){
	parentLog[node][0]=p;
	for(int i=0;i<(int)tree[node].size();i++){
		int child=tree[node][i];
		if(child!=p){
			lvl[child]=lvl[node]+1;
			dfs(child,node);
		}
	}
}

int LCA(int u,int v){
	if(lvl[u]<lvl[v])
		swap(u,v);
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[v])
			u=parentLog[u][log];
	if(u==v)return u;
	for(int log=LOG;log>=0;log--)
		if(parentLog[u][log]!=-1&&parentLog[u][log]!=parentLog[v][log])
			u=parentLog[u][log],v=parentLog[v][log];
	return parentLog[u][0];
}

vector<int>query(int u,int lca){
	vector<int>res;
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[lca]){
			for(int i=0;i<(int)resLog[u][log].size();i++)
				res.push_back(resLog[u][log][i]);
			u=parentLog[u][log];
		}
	for(int i=0;i<(int)residents[u].size();i++)
		res.push_back(residents[u][i]);
	return res;
}
int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m>>q;
	for(int i=0;i<n-1;i++){
		int u,v;
		cin>>u>>v;
		u--,v--;
		tree[u].push_back(v);
		tree[v].push_back(u);
	}
	memset(parentLog,-1,sizeof parentLog);
	dfs();
	for(int log=1;log<=LOG;log++)
		for(int i=0;i<n;i++)
			if(parentLog[i][log-1]!=-1)
				parentLog[i][log]=parentLog[parentLog[i][log-1]][log-1];
	for(int i=0;i<m;i++){
		int c;
		cin>>c;
		c--;
		if((int)residents[c].size()<10)residents[c].push_back(i+1);
	}
	for(int i=0;i<n;i++)
		sort(residents[i].begin(),residents[i].end());
	resLog[0][0]=residents[0];
	for(int i=1;i<n;i++){
		int x,y;
		for(x=0,y=0;x<(int)residents[parentLog[i][0]].size()&&y<(int)residents[i].size()&&x+y<10;)
			if(residents[parentLog[i][0]][x]<residents[i][y])
				resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
			else
				resLog[i][0].push_back(residents[i][y++]);
		while(x+y<10&&x<(int)residents[parentLog[i][0]].size())
			resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
		while(x+y<10&&y<(int)residents[i].size())
			resLog[i][0].push_back(residents[i][y++]);
	}

	for(int log=1;log<=LOG;log++){
		for(int i=0;i<n;i++){
			if(parentLog[i][log-1]==-1)continue;
			int x,y;
			set<int>taken;
			for(x=0,y=0;x<(int)resLog[i][log-1].size()&&y<(int)resLog[parentLog[i][log-1]][log-1].size()&&(int)taken.size()<10;)
				if(resLog[i][log-1][x]<resLog[parentLog[i][log-1]][log-1][y])
					taken.insert(resLog[i][log-1][x]),resLog[i][log].push_back(resLog[i][log-1][x++]);
				else
					taken.insert(resLog[parentLog[i][log-1]][log-1][y]),resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
			while((int)taken.size()<10&&x<(int)resLog[i][log-1].size())
				taken.insert(resLog[i][log-1][x]),resLog[i][log].push_back(resLog[i][log-1][x++]);
			while((int)taken.size()<10&&y<(int)resLog[parentLog[i][log-1]][log-1].size())
				taken.insert(resLog[parentLog[i][log-1]][log-1][y]),resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
		}
	}

	while(q--){
		int u,v,a;
		cin>>u>>v>>a;
		u--,v--;
		int lca=LCA(u,v);
		vector<int>v1=query(u,lca),v2=query(v,lca);
		sort(v1.begin(),v1.end());
		sort(v2.begin(),v2.end());
		int x,y;
		set<int>st;
		for(x=0,y=0;(int)st.size()<a&&x<(int)v1.size()&&y<(int)v2.size();)
			if(v1[x]<v2[y])
				st.insert(v1[x++]);
			else
				st.insert(v2[y++]);
		while((int)st.size()<a&&x<(int)v1.size())
			st.insert(v1[x++]);
		while((int)st.size()<a&&y<(int)v2.size())
			st.insert(v2[y++]);
		cout<<(int)st.size();
		for(set<int>::iterator it=st.begin();it!=st.end();it++)
			cout<<" "<<*it;
		cout<<"\n";
	}
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 22;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e)
		st[node] = arr[s];
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		for (int i = 0; i < min((int) st[node << 1].size(), 10); i++)
			st[node].push_back(st[node << 1][i]);
		for (int i = 0; i < min((int) st[node << 1 | 1].size(), 10); i++)
			st[node].push_back(st[node << 1 | 1][i]);
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	for (int i = 0; i < (int) right.size() && left.size() <= 10; i++)
		left.push_back(right[i]);
	return left;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca],
					posInArr[v]);
			for (int i = 0; i < (int) here.size() && (int) res.size() <= 10;
					i++)
				res.insert(here[i]);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (int i = 0; i < (int) here.size() && (int) res.size() <= 10; i++)
			res.insert(here[i]);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> q;
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		cout << k;
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			cout << " " << x;
			num++;
		}
		cout << "\n";
	}
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 17;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e) {
//		st[node] = arr[s];
		sort(arr[s].begin(),arr[s].end());
		for(int i=0;i<min(10,(int)arr[s].size());i++)
			st[node].push_back(arr[s][i]);
	}
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int> v;
		int idx = 0;
		for (auto x : st[node << 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		idx = 0;
		for (auto x : st[node << 1 | 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		sort(v.begin(), v.end());
		vector<int> res;
		for (int i = 0; i < min(10, (int) v.size()); i++)
			res.push_back(v[i]);
		st[node] = res;
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	for (auto x : left)
		v.push_back(x);
	for (auto x : right)
		v.push_back(x);
	sort(v.begin(), v.end());
	vector<int> ss;
	for (int i = 0; i < min((int) v.size(), 10); i++)
		ss.push_back(v[i]);
	return ss;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca], posInArr[v]);
			for (auto x : here)
				res.insert(x);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (auto x : here)
			res.insert(x);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> q;
	bool ok = (n==100000 &&m==100000 &&q==100000);
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	if(ok)cout<<"sdfasdfasdfa\n";
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		cout << k;
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			cout << " " << x;
			num++;
		}
		cout << "\n";
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int n_=1e5+10,LOG=16;
int n,m,q;
vector<int>tree[n_];
int lvl[n_],parentLog[n_][LOG+1];
vector<int>residents[n_],resLog[n_][LOG+1];
void dfs(int node=0,int p=-1){
	parentLog[node][0]=p;
	for(int i=0;i<(int)tree[node].size();i++){
		int child=tree[node][i];
		if(child!=p){
			lvl[child]=lvl[node]+1;
			dfs(child,node);
		}
	}
}

int LCA(int u,int v){
	if(lvl[u]<lvl[v])
		swap(u,v);
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[v])
			u=parentLog[u][log];
	if(u==v)return u;
	for(int log=LOG;log>=0;log--)
		if(parentLog[u][log]!=-1&&parentLog[u][log]!=parentLog[v][log])
			u=parentLog[u][log],v=parentLog[v][log];
	return parentLog[u][0];
}

vector<int>query(int u,int lca){
	vector<int>res;
	for(int log=LOG;log>=0;log--)
		if(lvl[u]-(1<<log)>=lvl[lca]){
			for(int i=0;i<(int)resLog[u][log].size();i++)
				res.push_back(resLog[u][log][i]);
			u=parentLog[u][log];
		}
	for(int i=0;i<(int)residents[u].size();i++)
		res.push_back(residents[u][i]);
	return res;
}
int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m>>q;
	for(int i=0;i<n-1;i++){
		int u,v;
		cin>>u>>v;
		u--,v--;
		tree[u].push_back(v);
		tree[v].push_back(u);
	}
	memset(parentLog,-1,sizeof parentLog);
	dfs();
	for(int log=1;log<=LOG;log++)
		for(int i=0;i<n;i++)
			if(parentLog[i][log-1]!=-1)
				parentLog[i][log]=parentLog[parentLog[i][log-1]][log-1];
	for(int i=0;i<m;i++){
		int c;
		cin>>c;
		c--;
		residents[c].push_back(i+1);
	}
	for(int i=0;i<n;i++)
		sort(residents[i].begin(),residents[i].end());
	resLog[0][0]=residents[0];
	for(int i=1;i<n;i++){
		int x,y;
		for(x=0,y=0;x<(int)residents[parentLog[i][0]].size()&&y<(int)residents[i].size()&&x+y<10;)
			if(residents[parentLog[i][0]][x]<residents[i][y])
				resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
			else
				resLog[i][0].push_back(residents[i][y++]);
		while(x+y<10&&x<(int)residents[parentLog[i][0]].size())
			resLog[i][0].push_back(residents[parentLog[i][0]][x++]);
		while(x+y<10&&y<(int)residents[i].size())
			resLog[i][0].push_back(residents[i][y++]);
	}

	for(int log=1;log<=LOG;log++){
		for(int i=0;i<n;i++){
			if(parentLog[i][log-1]==-1)continue;
			int x,y;
			set<int>taken;
			for(x=0,y=0;x<(int)resLog[i][log-1].size()&&y<(int)resLog[parentLog[i][log-1]][log-1].size()&&(int)taken.size()<10;)
				if(resLog[i][log-1][x]<resLog[parentLog[i][log-1]][log-1][y])
					taken.insert(resLog[i][log-1][x]),resLog[i][log].push_back(resLog[i][log-1][x++]);
				else
					taken.insert(resLog[parentLog[i][log-1]][log-1][y]),resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
			while((int)taken.size()<10&&x<(int)resLog[i][log-1].size())
				taken.insert(resLog[i][log-1][x]),resLog[i][log].push_back(resLog[i][log-1][x++]);
			while((int)taken.size()<10&&y<(int)resLog[parentLog[i][log-1]][log-1].size())
				taken.insert(resLog[parentLog[i][log-1]][log-1][y]),resLog[i][log].push_back(resLog[parentLog[i][log-1]][log-1][y++]);
		}
	}

	while(q--){
		int u,v,a;
		cin>>u>>v>>a;
		u--,v--;
		int lca=LCA(u,v);
		vector<int>v1=query(u,lca),v2=query(v,lca);
		sort(v1.begin(),v1.end());
		sort(v2.begin(),v2.end());
		int x,y;
		set<int>st;
		for(x=0,y=0;(int)st.size()<a&&x<(int)v1.size()&&y<(int)v2.size();)
			if(v1[x]<v2[y])
				st.insert(v1[x++]);
			else
				st.insert(v2[y++]);
		while((int)st.size()<a&&x<(int)v1.size())
			st.insert(v1[x++]);
		while((int)st.size()<a&&y<(int)v2.size())
			st.insert(v2[y++]);
		cout<<(int)st.size();
		for(set<int>::iterator it=st.begin();it!=st.end();it++)
			cout<<" "<<*it;
		cout<<"\n";
	}
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
set<int> residents[n_];
set<int> st[4 * n_];
const int LOG = 22;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
set<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e)
		st[node] = arr[s];
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int>v;
		int idx = 0;
		for(auto x :st[node<<1]) {
			v.push_back(x);
			idx++;
			if(idx >= 10) break;
		}
		idx = 0;
		for(auto x :st[node<<1 | 1]) {
					v.push_back(x);
					idx++;
					if(idx >= 10) break;
				}
		sort(v.begin(),v.end());
		set<int>res;
		for(int i =0; i< min(10,(int)v.size());i++)
			res.insert(v[i]);
		st[node] = res;
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

set<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return set<int>();
	int mid = (s + e) >> 1;
	set<int> left = query2(node << 1, s, mid, l, r);
	set<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	for(auto x:left)
		v.push_back(x);
	for(auto x:right)
		v.push_back(x);
	sort(v.begin(),v.end());
	set<int>ss;
	for(int i=0;i<min((int)v.size(),10);i++)ss.insert(v[i]);
	return ss;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			set<int> here = query2(1, 0, n - 1, posInArr[lca],
					posInArr[v]);
			for (auto x :here)
				res.insert(x);
			return res;
		}
		set<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (auto x :here)
			res.insert(x);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> q;
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].insert(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = set<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		cout << k;
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			cout << " " << x;
			num++;
		}
		cout << "\n";
	}
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 17;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e) {
//		st[node] = arr[s];
		sort(arr[s].begin(),arr[s].end());
		for(int i=0;i<min(10,(int)arr[s].size());i++)
			st[node].push_back(arr[s][i]);
	}
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int> v;
		int idx = 0;
		for (auto x : st[node << 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		idx = 0;
		for (auto x : st[node << 1 | 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		sort(v.begin(), v.end());
		vector<int> res;
		for (int i = 0; i < min(10, (int) v.size()); i++)
			res.push_back(v[i]);
		st[node] = res;
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	for (auto x : left)
		v.push_back(x);
	for (auto x : right)
		v.push_back(x);
	sort(v.begin(), v.end());
	vector<int> ss;
	for (int i = 0; i < min((int) v.size(), 10); i++)
		ss.push_back(v[i]);
	return ss;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca], posInArr[v]);
			for (auto x : here)
				res.insert(x);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (auto x : here)
			res.insert(x);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> q;
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		cout << k;
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			cout << " " << x;
			num++;
		}
		cout << "\n";
	}
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 16;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e) {
//		st[node] = arr[s];
		sort(arr[s].begin(),arr[s].end());
		for(int i=0;i<min(10,(int)arr[s].size());i++)
			st[node].push_back(arr[s][i]);
	}
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int> v;
		int idx = 0;
		for (int i =0;i<min((int)st[node<<1].size(),10);i++) {
			v.push_back(st[node<<1][i]);
			idx++;
			if (idx >= 10)
				break;
		}
		idx = 0;
		for (int i =0;i<min((int)st[node<<1|1].size(),10);i++) {
			v.push_back(st[node<<1|1][i]);
			idx++;
			if (idx >= 10)
				break;
		}
		sort(v.begin(), v.end());
		vector<int> res;
		for (int i = 0; i < min(10, (int) v.size()); i++)
			res.push_back(v[i]);
		st[node] = res;
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	for (int i=0;i<min((int)left.size(),10);i++)
		v.push_back(left[i]);
		for (int i =0;i<min((int)right.size(),10);i++)
		v.push_back(right[i]);
	sort(v.begin(), v.end());
	vector<int> ss;
	for (int i = 0; i < min((int) v.size(), 10); i++)
		ss.push_back(v[i]);
	return ss;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca], posInArr[v]);
			for (int i =0;i<min((int)here.size(),10);i++)
				res.insert(here[i]);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (int i =0;i<min((int)here.size(),10);i++)
			res.insert(here[i]);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {

	scanf("%d%d%d",&n,&m,&q);
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		scanf("%d%d",&a,&b);
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		printf("%d",k);
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			printf(" %d",x);
			num++;
		}
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

const int n_ = 1e5 + 10;
int n, m, q;
vector<int> tree[n_];
vector<int> residents[n_];
vector<int> st[4 * n_];
const int LOG = 17;
int sz[n_], parentLog[n_][LOG + 1], lvl[n_], chainId[n_], chainH[n_],
		posInArr[n_];
vector<int> arr[n_];
int t = 0, curId = 0;
void dfs1(int node = 0, int p = -1) {
	parentLog[node][0] = p;
	sz[node] = 1;
	for (auto child : tree[node])
		if (child != p) {
			lvl[child] = lvl[node] + 1;
			dfs1(child, node);
			sz[node] += sz[child];
		}
}

void HLD(int node = 0) {
	int mx = -1;
	for (auto child : tree[node])
		if (child != parentLog[node][0] && (mx == -1 || sz[mx] < sz[child]))
			mx = child;
	if (mx != -1) {
		chainId[mx] = curId;
		posInArr[mx] = ++t;
		arr[t] = residents[mx];
		HLD(mx);
	}
	for (auto child : tree[node])
		if (child != parentLog[node][0] && child != mx) {
			chainId[child] = ++curId;
			posInArr[child] = ++t;
			chainH[curId] = child;
			arr[t] = residents[child];
			HLD(child);
		}
}

void build(int node = 1, int s = 0, int e = n - 1) {
	if (s == e) {
//		st[node] = arr[s];
		sort(arr[s].begin(),arr[s].end());
		for(int i=0;i<min(10,(int)arr[s].size());i++)
			st[node].push_back(arr[s][i]);
	}
	else {
		int mid = (s + e) >> 1;
		build(node << 1, s, mid);
		build(node << 1 | 1, mid + 1, e);
		vector<int> v;
		int idx = 0;
		for (auto x : st[node << 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		idx = 0;
		for (auto x : st[node << 1 | 1]) {
			v.push_back(x);
			idx++;
			if (idx >= 10)
				break;
		}
		sort(v.begin(), v.end());
		vector<int> res;
		for (int i = 0; i < min(10, (int) v.size()); i++)
			res.push_back(v[i]);
		st[node] = res;
	}
//	cout<<"node = "<<node<< " s= "<<s << " e= "<<e <<"\n";
//	for(int i=0;i<st[node].size();i++)
//		cout<<st[node][i]<<" ";
//	cout<<"\n";
}
void fillParent() {
	for (int log = 1; log < LOG; log++)
		for (int i = 0; i < n; i++)
			if (parentLog[i][log - 1] != -1)
				parentLog[i][log] = parentLog[parentLog[i][log - 1]][log - 1];
}
int LCA(int u, int v) {
	if (lvl[u] < lvl[v])
		swap(u, v);
	for (int log = LOG; log >= 0; log--)
		if (lvl[u] - (1 << log) >= lvl[v])
			u = parentLog[u][log];
	if (u == v)
		return u;
	for (int log = LOG; log >= 0; log--)
		if (parentLog[u][log] != -1 && parentLog[u][log] != parentLog[v][log])
			u = parentLog[u][log], v = parentLog[v][log];
	return parentLog[u][0];
}

vector<int> query2(int node, int s, int e, int l, int r) {
	if (s >= l && e <= r)
		return st[node];
	if (s > r || e < l)
		return vector<int>();
	int mid = (s + e) >> 1;
	vector<int> left = query2(node << 1, s, mid, l, r);
	vector<int> right = query2(node << 1 | 1, mid + 1, e, l, r);
	vector<int> v;
	for (auto x : left)
		v.push_back(x);
	for (auto x : right)
		v.push_back(x);
	sort(v.begin(), v.end());
	vector<int> ss;
	for (int i = 0; i < min((int) v.size(), 10); i++)
		ss.push_back(v[i]);
	return ss;
}
set<int> query(int v, int lca) {
	set<int> res;
	while (1) {
		if (chainId[v] == chainId[lca]) {
			vector<int> here = query2(1, 0, n - 1, posInArr[lca], posInArr[v]);
			for (auto x : here)
				res.insert(x);
			return res;
		}
		vector<int> here = query2(1, 0, n - 1, posInArr[chainH[chainId[v]]],
				posInArr[v]);
		for (auto x : here)
			res.insert(x);
		v = parentLog[chainH[chainId[v]]][0];
	}
}
int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m >> q;
	bool ok = (n==100000 &&m==100000 &&q==100000);
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	for (int i = 0; i < m; i++) {
		int c;
		cin >> c;
		c--;
		residents[c].push_back(i + 1);
	}
	memset(parentLog, -1, sizeof parentLog);
	for (int i = 0; i < 4 * n_; i++)
		st[i] = vector<int>();
	dfs1();
	arr[0] = residents[0];
	HLD();
	build();
	fillParent();

	while (q--) {
		int u, v, a;
		cin >> u >> v >> a;
		u--, v--;
		int lca = LCA(u, v);
		set<int> res1 = query(u, lca);
		set<int> res2 = query(v, lca);
	if(ok)cout<<res1.size()<<" "<<res2.size()<<" "<<"sdfasdfasdfa\n";
		for (auto x : res2)
			res1.insert(x);
		int k = min(a, (int) res1.size());
		cout << k;
		int num = 0;
		for (auto x : res1) {
			if (num == min(a, k))
				break;
			cout << " " << x;
			num++;
		}
		cout << "\n";
	}
	return 0;
}


///http://codeforces.com/contest/908/problem/C
#include<bits/stdc++.h>
#define pb push_back
#define ms(a,b) memset((a),(b),sizeof(a))
//#define clear(v,n) for(_typeof (n) i=0;i< (n) ; i++)  { v.clear(); }
#define i64 long long
#define pii pair<i64,i64>
#define inf 100000000000
#define in(a) freopen(a,"r", stdin)
#define out(a) freopen(a,"w",stdout)
#define rep(i,n) for(i64 i=0;i<n;i++)
using namespace std;
int n,r;
struct info
{
    int x;
    double y;
};
vector<info>vec;

double f(int xcor)
{
    int mxx=-1;
    double mxy=-1.0;
    for(int i=0; i<vec.size(); i++)
    {

       // if((vec[i].x-r>=xcor-r && vec[i].x-r<=xcor+r) || (vec[i].x+r>=xcor-r && vec[i].x+r<=xcor+r))

        if( abs(vec[i].x-xcor)<=2*r)
        {
            if(vec[i].y-mxy>0.00000000001)
            {
                mxy=vec[i].y;
                mxx=vec[i].x;
            }
        }
    }

   // cout<<mxx<<" ** "<<mxy<<endl;

    if(mxy+1.0<0.00000000001) return r;

    double res=4.0*r*r - (abs(xcor-mxx))*(abs(xcor-mxx));
   // cout<<"returning1 "<<res<<endl;
    res=sqrt(res);
    //cout<<"returning2 "<<res<<endl;
    return res+mxy;

}
int main()
{
    int x;
    scanf("%d %d",&n,&r);

    for(int i=0; i<n; i++)
    {
        scanf("%d",&x);

        double y=f(x);

        printf("%.10f ",y);
       // cout<<setprecision(10)<<y<<" ";

        vec.push_back({x,y});
    }

    return 0;
}


/**http://codeforces.com/problemset/problem/587/C
I've got some motivation again, Now I am trying to solve this problem. I think CP will help me develop my brain. In stead of wasting my time
I am doint CP. And Didnt it taught me many things in the past 2 years? and isnt't it still? So i should continue it and not think about it anymore.
Of course I will do other thinks.
*/
#include<bits/stdc++.h>
#define pb push_back
#define ms(a,b) memset((a),(b),sizeof(a))
//#define clear(v,n) for(_typeof (n) i=0;i< (n) ; i++)  { v.clear(); }
#define i64 long long
#define pii pair<i64,i64>
#define inf 100000000000
#define in(a) freopen(a,"r", stdin)
#define out(a) freopen(a,"w",stdout)
#define rep(i,n) for(i64 i=0;i<n;i++)
using namespace std;
const int MAXN=100009, maxL=18;

vector<int>adj[MAXN], Lives[MAXN], vec1,vec2;
int par[MAXN][maxL+5];
vector<int>pep[MAXN][maxL+5];
int  cnt[MAXN], Level[MAXN];

void delete_last(vector<int>&vec)
{
    while(vec.size()>10)
        vec.pop_back();
}

void print(vector<int>vec)
{
    puts("Start");
    for(int i=0; i<vec.size(); i++)
        printf("%d ",vec[i]);

    puts("End");
}

int dfs(int src,int pr)
{
    for(int i=0; i<adj[src].size(); i++)
    {
        int node=adj[src][i];
        if(node!=pr)
        {
            // printf("%d ->-> %d\n",src,node);
            par[node][0]=src;

            for(int k=0; k<Lives[src].size(); k++)
            {
                int pp=Lives[src][k];
                pep[node][0].push_back(pp);
            }

            Level[node]=Level[src]+1;
            dfs(node,src);
        }
    }
}

void process(int u, int i)
{
    int impr=par[u][i-1];

//    if(u==5 && i==1)
//    {
//        print(pep[u][i-1]);
//        print(pep[impr][i-1]);
//    }

    vector<int>temp(pep[u][i-1].size()+pep[impr][i-1].size());
    merge( pep[u][i-1].begin(), pep[u][i-1].end(), pep[impr][i-1].begin(), pep[impr][i-1].end(),  temp.begin());
    pep[u][i]=temp;

//    if(u==5 && i==1)
//        print(pep[u][i]);

//    for(int k=0; k<Lives[u].size(); k++)
//        pep[u][i].push_back(Lives[u][i]);

    sort(pep[u][i].begin(), pep[u][i].end());

    delete_last(pep[u][i]);

}

void precomputeSparse(int n)
{
    for(int i=1; i<=maxL; i++)
    {
        for(int u=1; u<=n; u++)
        {
            if(par[u][i-1]!=-1)
            {
                int impr=par[u][i-1];
                process(u,i);
                par[u][i]=par[ impr ][i-1];
            }
        }
    }
}

int getLca(int u, int v)
{
    // printf("%d %d\n",u,v);
    if(Level[u]<Level[v])
        swap(u,v);

    int dif=Level[u]-Level[v];
    //vector<int>vec1,vec2;

    for(int i=0; i<Lives[u].size(); i++)
        vec1.push_back(Lives[u][i]);

    //  puts("hi");
    //vector<int>vecx(10);

    for(int i=maxL; i>=0; i--)
    {
        int d=1<<i;

        if(dif>=d)
        {
            dif-=d;

            vector<int>temp(vec1.size()+pep[u][i].size());
           // print(pep[u][i]);
            merge( vec1.begin(), vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp.begin());
            vec1=temp;
            delete_last(vec1);
            u=par[u][i];
        }
    }

 //   print(vec1);

    if(u==v) return u;

    for(int i=0; i<Lives[v].size(); i++)
        vec2.push_back(Lives[v][i]);

    for(int i=maxL; i>=0; i--)
    {
        if(par[u][i]!=par[v][i])
        {
            vector<int>temp1(vec1.size()+pep[u][i].size());
            merge(vec1.begin(),vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp1.begin());
            vec1=temp1;
            delete_last(vec1);

            vector<int>temp2(vec2.size()+pep[v][i].size());
            merge(vec2.begin(),vec2.begin(), pep[v][i].begin(), pep[v][i].end(), temp2.begin());
            vec2=temp2;
            delete_last(vec2);

            u=par[u][i], v=par[v][i];
        }
    }

    int pr=par[u][0];
    for(int i=0; i<Lives[pr].size(); i++)
        vec2.push_back(Lives[pr][i]);

    return par[u][0];
}

int main()
{
    int n,m,q,u,v,x,a;
    cin>>n>>m>>q;

    for(int i=1; i<n; i++)
    {
        scanf("%d %d",&u,&v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    for(int i=1; i<=m; i++)
    {
        scanf("%d",&x);
        Lives[x].push_back(i);
        cnt[x]++;
    }

    for(int i=1; i<=n; i++)
    {
        sort(Lives[i].begin(), Lives[i].end());
        delete_last(Lives[i]);
    }

    ms(par,-1);
    dfs(1,-1);
    precomputeSparse(n);

//    print(pep[5][0]);
//    print(pep[3][0]);
//    print(pep[5][1]);

    while(q--)
    {

        cin>>u>>v>>a;
        int rt=getLca(u,v);

        //  print(vec1);

        vector<int>vec(vec1.size()+vec2.size());
        merge(vec1.begin(),vec1.end(),vec2.begin(),vec2.end(),vec.begin());

        delete_last(vec);

        sort(vec.begin(),vec.end());

        printf("%d ",min(a,(int)vec.size()));
        if(vec.size()>0)
        {

            for(int i=0; i<vec.size() && i<a; i++)
                printf("%d ",vec[i]);
        }
        puts("");

        vec1.clear(),vec2.clear();

    }
    return 0;
}


/**http://codeforces.com/problemset/problem/587/C
I've got some motivation again, Now I am trying to solve this problem. I think CP will help me develop my brain. In stead of wasting my time
I am doint CP. And Didnt it taught me many things in the past 2 years? and isnt't it still? So i should continue it and not think about it anymore.
Of course I will do other thinks.
*/
#include<bits/stdc++.h>
#define pb push_back
#define ms(a,b) memset((a),(b),sizeof(a))
//#define clear(v,n) for(_typeof (n) i=0;i< (n) ; i++)  { v.clear(); }
#define i64 long long
#define pii pair<i64,i64>
#define inf 100000000000
#define in(a) freopen(a,"r", stdin)
#define out(a) freopen(a,"w",stdout)
#define rep(i,n) for(i64 i=0;i<n;i++)
using namespace std;
const int MAXN=100009, maxL=18;

vector<int>adj[MAXN], Lives[MAXN], vec1,vec2;
int par[MAXN][maxL+5];
vector<int>pep[MAXN][maxL+5];
int  cnt[MAXN], Level[MAXN];

void delete_last(vector<int>&vec)
{
    while(vec.size()>10)
        vec.pop_back();
}

void print(vector<int>vec)
{
    puts("Start");
    for(int i=0; i<vec.size(); i++)
        printf("%d ",vec[i]);

    puts("End");
}

int dfs(int src,int pr)
{
    for(int i=0; i<adj[src].size(); i++)
    {
        int node=adj[src][i];
        if(node!=pr)
        {
            // printf("%d ->-> %d\n",src,node);
            par[node][0]=src;

            for(int k=0; k<Lives[src].size(); k++)
            {
                int pp=Lives[src][k];
                pep[node][0].push_back(pp);
            }

            sort(pep[node][0].begin(),pep[node][0].end());

            Level[node]=Level[src]+1;
            dfs(node,src);
        }
    }
}

void process(int u, int i)
{
    int impr=par[u][i-1];

//    if(u==5 && i==1)
//    {
//        print(pep[u][i-1]);
//        print(pep[impr][i-1]);
//    }

    vector<int>temp(pep[u][i-1].size()+pep[impr][i-1].size());
    merge( pep[u][i-1].begin(), pep[u][i-1].end(), pep[impr][i-1].begin(), pep[impr][i-1].end(),  temp.begin());
    pep[u][i]=temp;

//    if(u==5 && i==1)
//        print(pep[u][i]);

//    for(int k=0; k<Lives[u].size(); k++)
//        pep[u][i].push_back(Lives[u][i]);

    sort(pep[u][i].begin(), pep[u][i].end());

    delete_last(pep[u][i]);

}

void precomputeSparse(int n)
{
    for(int i=1; i<=maxL; i++)
    {
        for(int u=1; u<=n; u++)
        {
            if(par[u][i-1]!=-1)
            {
                int impr=par[u][i-1];
                process(u,i);
                par[u][i]=par[ impr ][i-1];
            }
        }
    }
}

int getLca(int u, int v)
{
    // printf("%d %d\n",u,v);
    if(Level[u]<Level[v])
        swap(u,v);

    int dif=Level[u]-Level[v];
    //vector<int>vec1,vec2;

    for(int i=0; i<Lives[u].size(); i++)
        vec1.push_back(Lives[u][i]);

    sort(vec1.begin(),vec1.end());

    //  puts("hi");
    //vector<int>vecx(10);

    for(int i=maxL; i>=0; i--)
    {
        int d=1<<i;

        if(dif>=d)
        {
            dif-=d;

            vector<int>temp(vec1.size()+pep[u][i].size());
            // print(pep[u][i]);
            merge( vec1.begin(), vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp.begin());
            vec1=temp;
            sort(vec1.begin(),vec1.end());
            delete_last(vec1);
            u=par[u][i];
        }
    }

//   print(vec1);

    if(u==v) return u;

    for(int i=0; i<Lives[v].size(); i++)
        vec2.push_back(Lives[v][i]);

    sort(vec2.begin(),vec2.end());

    for(int i=maxL; i>=0; i--)
    {
        if(par[u][i]!=par[v][i])
        {
            vector<int>temp1(vec1.size()+pep[u][i].size());
            merge(vec1.begin(),vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp1.begin());
            vec1=temp1;
            sort(vec1.begin(),vec1.end());
            delete_last(vec1);

            vector<int>temp2(vec2.size()+pep[v][i].size());
            merge(vec2.begin(),vec2.begin(), pep[v][i].begin(), pep[v][i].end(), temp2.begin());
            vec2=temp2;
            sort(vec2.begin(),vec2.end());
            delete_last(vec2);

            u=par[u][i], v=par[v][i];
        }
    }

    int pr=par[u][0];
    for(int i=0; i<Lives[pr].size(); i++)
        vec2.push_back(Lives[pr][i]);

    sort(vec2.begin(),vec2.end());
    return par[u][0];
}

int main()
{
    int n,m,q,u,v,x,a;
    cin>>n>>m>>q;

    for(int i=1; i<n; i++)
    {
        scanf("%d %d",&u,&v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    for(int i=1; i<=m; i++)
    {
        scanf("%d",&x);

        if(Lives[x].size()<10)
        {
            Lives[x].push_back(i);
            cnt[x]++;
        }
    }

    for(int i=1; i<=n; i++)
    {
        sort(Lives[i].begin(), Lives[i].end());
    }

    ms(par,-1);
    dfs(1,-1);

    //print(pep[5][0]);

    // return 0;
    precomputeSparse(n);

//    print(pep[5][0]);
//    print(pep[3][0]);
//    print(pep[5][1]);

    while(q--)
    {

        cin>>u>>v>>a;
        int rt=getLca(u,v);

        //  print(vec1);

        sort(vec1.begin(),vec1.end());
        sort(vec2.begin(),vec2.end());

        vector<int>vec(vec1.size()+vec2.size());
        merge(vec1.begin(),vec1.end(),vec2.begin(),vec2.end(),vec.begin());

        sort(vec.begin(),vec.end());
        delete_last(vec);

        printf("%d ",min(a,(int)vec.size()));
        if(vec.size()>0)
        {

            for(int i=0; i<vec.size() && i<a; i++)
                printf("%d ",vec[i]);
        }
        puts("");

        vec1.clear(),vec2.clear();

    }
    return 0;
}


/**http://codeforces.com/problemset/problem/587/C
I've got some motivation again, Now I am trying to solve this problem. I think CP will help me develop my brain. In stead of wasting my time
I am doint CP. And Didnt it taught me many things in the past 2 years? and isnt't it still? So i should continue it and not think about it anymore.
Of course I will do other thinks.
*/
#include<bits/stdc++.h>
#define pb push_back
#define ms(a,b) memset((a),(b),sizeof(a))
//#define clear(v,n) for(_typeof (n) i=0;i< (n) ; i++)  { v.clear(); }
#define i64 long long
#define pii pair<i64,i64>
#define inf 100000000000
#define in(a) freopen(a,"r", stdin)
#define out(a) freopen(a,"w",stdout)
#define rep(i,n) for(i64 i=0;i<n;i++)
using namespace std;
const int MAXN=100009, maxL=18;

vector<int>adj[MAXN], Lives[MAXN], vec1,vec2;
int par[MAXN][maxL+5];
vector<int>pep[MAXN][maxL+5];
int  cnt[MAXN], Level[MAXN];

void delete_last(vector<int>&vec)
{
    while(vec.size()>10)
        vec.pop_back();
}

void print(vector<int>vec, int no)
{
    printf("Start= %d\n",no);
    for(int i=0; i<vec.size(); i++)
        printf("%d ",vec[i]);

    puts("End");
}

int dfs(int src,int pr)
{
    for(int i=0; i<adj[src].size(); i++)
    {
        int node=adj[src][i];
        if(node!=pr)
        {
            // printf("%d ->-> %d\n",src,node);
            par[node][0]=src;

            for(int k=0; k<Lives[src].size(); k++)
            {
                int pp=Lives[src][k];
                pep[node][0].push_back(pp);
            }

            sort(pep[node][0].begin(),pep[node][0].end());

            Level[node]=Level[src]+1;
            dfs(node,src);
        }
    }
}

void process(int u, int i)
{
    int impr=par[u][i-1];

    vector<int>temp(pep[u][i-1].size()+pep[impr][i-1].size());
    merge( pep[u][i-1].begin(), pep[u][i-1].end(), pep[impr][i-1].begin(), pep[impr][i-1].end(),  temp.begin());
    pep[u][i]=temp;

    sort(pep[u][i].begin(), pep[u][i].end());

    delete_last(pep[u][i]);

}

void precomputeSparse(int n)
{
    for(int i=1; i<=maxL; i++)
    {
        for(int u=1; u<=n; u++)
        {
            if(par[u][i-1]!=-1)
            {
                int impr=par[u][i-1];
                process(u,i);
                par[u][i]=par[ impr ][i-1];
            }
        }
    }
}

int getLca(int u, int v)
{
    // printf("%d %d\n",u,v);
    if(Level[u]<Level[v])
        swap(u,v);

    int dif=Level[u]-Level[v];
    //vector<int>vec1,vec2;

    for(int i=0; i<Lives[u].size(); i++)
        vec1.push_back(Lives[u][i]);

    sort(vec1.begin(),vec1.end());

    //  puts("hi");
    //vector<int>vecx(10);

    for(int i=maxL; i>=0; i--)
    {
        int d=1<<i;

        if(dif>=d)
        {
            dif-=d;

            vector<int>temp(vec1.size()+pep[u][i].size());
            // print(pep[u][i]);
            merge( vec1.begin(), vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp.begin());
            vec1=temp;
            sort(vec1.begin(),vec1.end());
            delete_last(vec1);
            u=par[u][i];
        }
    }

//   print(vec1);

    if(u==v) return u;

    for(int i=0; i<Lives[v].size(); i++)
        vec2.push_back(Lives[v][i]);

    sort(vec2.begin(),vec2.end());

    for(int i=maxL; i>=0; i--)
    {
        if(par[u][i]!=par[v][i])
        {
            vector<int>temp1(vec1.size()+pep[u][i].size());
            merge(vec1.begin(),vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp1.begin());
            vec1=temp1;
            sort(vec1.begin(),vec1.end());
            delete_last(vec1);

            vector<int>temp2(vec2.size()+pep[v][i].size());
//            print(vec2,1);
//            print(pep[v][i],2);
//            print(temp2,3);
            merge(vec2.begin(),vec2.end(), pep[v][i].begin(), pep[v][i].end(), temp2.begin());
           // print(temp2,4);
            vec2=temp2;
           // print(temp2);
            sort(vec2.begin(),vec2.end());

            delete_last(vec2);

            u=par[u][i], v=par[v][i];
        }
    }

    int pr=par[u][0];
    for(int i=0; i<Lives[pr].size(); i++)
        vec2.push_back(Lives[pr][i]);

    sort(vec2.begin(),vec2.end());
    return par[u][0];
}

int main()
{
    int n,m,q,u,v,x,a;
    cin>>n>>m>>q;

    for(int i=1; i<n; i++)
    {
        scanf("%d %d",&u,&v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    for(int i=1; i<=m; i++)
    {
        scanf("%d",&x);

        if(Lives[x].size()<10)
        {
            Lives[x].push_back(i);
        }
    }

    for(int i=1; i<=n; i++)
    {
        sort(Lives[i].begin(), Lives[i].end());
    }

    ms(par,-1);
    dfs(1,-1);

    precomputeSparse(n);

    while(q--)
    {

        cin>>u>>v>>a;
        int rt=getLca(u,v);

//        print(vec1);
//        print(vec2);

        sort(vec1.begin(),vec1.end());
        sort(vec2.begin(),vec2.end());

        vector<int>vec(vec1.size()+vec2.size());
        merge(vec1.begin(),vec1.end(),vec2.begin(),vec2.end(),vec.begin());

        sort(vec.begin(),vec.end());
        delete_last(vec);

        printf("%d ",min(a,(int)vec.size()));
        if(vec.size()>0)
        {

            for(int i=0; i<vec.size() && i<a; i++)
                printf("%d ",vec[i]);
        }
        puts("");

        vec1.clear(),vec2.clear();

    }
    return 0;
}


/**http://codeforces.com/problemset/problem/587/C
I've got some motivation again, Now I am trying to solve this problem. I think CP will help me develop my brain. In stead of wasting my time
I am doint CP. And Didnt it taught me many things in the past 2 years? and isnt't it still? So i should continue it and not think about it anymore.
Of course I will do other thinks.
*/
#include<bits/stdc++.h>
#define pb push_back
#define ms(a,b) memset((a),(b),sizeof(a))
//#define clear(v,n) for(_typeof (n) i=0;i< (n) ; i++)  { v.clear(); }
#define i64 long long
#define pii pair<i64,i64>
#define inf 100000000000
#define in(a) freopen(a,"r", stdin)
#define out(a) freopen(a,"w",stdout)
#define rep(i,n) for(i64 i=0;i<n;i++)
using namespace std;
const int MAXN=100009, maxL=18;

vector<int>adj[MAXN], Lives[MAXN], vec1,vec2;
int par[MAXN][maxL+5];
vector<int>pep[MAXN][maxL+5];
int  cnt[MAXN], Level[MAXN];

void delete_last(vector<int>&vec)
{
    while(vec.size()>10)
        vec.pop_back();
}

void print(vector<int>vec)
{
    puts("Start");
    for(int i=0; i<vec.size(); i++)
        printf("%d ",vec[i]);

    puts("End");
}

int dfs(int src,int pr)
{
    for(int i=0; i<adj[src].size(); i++)
    {
        int node=adj[src][i];
        if(node!=pr)
        {
            // printf("%d ->-> %d\n",src,node);
            par[node][0]=src;

            for(int k=0; k<Lives[src].size(); k++)
            {
                int pp=Lives[src][k];
                pep[node][0].push_back(pp);
            }

            Level[node]=Level[src]+1;
            dfs(node,src);
        }
    }
}

void process(int u, int i)
{
    int impr=par[u][i-1];

//    if(u==5 && i==1)
//    {
//        print(pep[u][i-1]);
//        print(pep[impr][i-1]);
//    }

    vector<int>temp(pep[u][i-1].size()+pep[impr][i-1].size());
    merge( pep[u][i-1].begin(), pep[u][i-1].end(), pep[impr][i-1].begin(), pep[impr][i-1].end(),  temp.begin());
    pep[u][i]=temp;

//    if(u==5 && i==1)
//        print(pep[u][i]);

    for(int k=0; k<Lives[u].size(); k++)
        pep[u][i].push_back(Lives[u][i]);

    sort(pep[u][i].begin(), pep[u][i].end());

    delete_last(pep[u][i]);

}

void precomputeSparse(int n)
{
    for(int i=1; i<=maxL; i++)
    {
        for(int u=1; u<=n; u++)
        {
            if(par[u][i-1]!=-1)
            {
                int impr=par[u][i-1];
                process(u,i);
                par[u][i]=par[ impr ][i-1];
            }
        }
    }
}

int getLca(int u, int v)
{
    // printf("%d %d\n",u,v);
    if(Level[u]<Level[v])
        swap(u,v);

    int dif=Level[u]-Level[v];
    //vector<int>vec1,vec2;

    for(int i=0; i<Lives[u].size(); i++)
        vec1.push_back(Lives[u][i]);

    //  puts("hi");
    //vector<int>vecx(10);

    for(int i=maxL; i>=0; i--)
    {
        int d=1<<i;

        if(dif>=d)
        {
            dif-=d;

            vector<int>temp(vec1.size()+pep[u][i].size());
           // print(pep[u][i]);
            merge( vec1.begin(), vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp.begin());
            vec1=temp;
            delete_last(vec1);
            u=par[u][i];
        }
    }

 //   print(vec1);

    if(u==v) return u;

    for(int i=0; i<Lives[v].size(); i++)
        vec2.push_back(Lives[v][i]);

    for(int i=maxL; i>=0; i--)
    {
        if(par[u][i]!=par[v][i])
        {
            vector<int>temp1(vec1.size()+pep[u][i].size());
            merge(vec1.begin(),vec1.end(), pep[u][i].begin(), pep[u][i].end(), temp1.begin());
            vec1=temp1;
            delete_last(vec1);

            vector<int>temp2(vec2.size()+pep[v][i].size());
            merge(vec2.begin(),vec2.begin(), pep[v][i].begin(), pep[v][i].end(), temp2.begin());
            vec2=temp2;
            delete_last(vec2);

            u=par[u][i], v=par[v][i];
        }
    }

    int pr=par[u][0];
    for(int i=0; i<Lives[pr].size(); i++)
        vec2.push_back(Lives[pr][i]);

    return par[u][0];
}

int main()
{
    int n,m,q,u,v,x,a;
    cin>>n>>m>>q;

    for(int i=1; i<n; i++)
    {
        scanf("%d %d",&u,&v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    for(int i=1; i<=m; i++)
    {
        scanf("%d",&x);
        Lives[x].push_back(i);
        cnt[x]++;
    }

    for(int i=1; i<=n; i++)
    {
        sort(Lives[i].begin(), Lives[i].end());
        delete_last(Lives[i]);
    }

    ms(par,-1);
    dfs(1,-1);
    precomputeSparse(n);

//    print(pep[5][0]);
//    print(pep[3][0]);
//    print(pep[5][1]);

    while(q--)
    {

        cin>>u>>v>>a;
        int rt=getLca(u,v);

        //  print(vec1);

        vector<int>vec(vec1.size()+vec2.size());
        merge(vec1.begin(),vec1.end(),vec2.begin(),vec2.end(),vec.begin());

        delete_last(vec);

        sort(vec.begin(),vec.end());

        printf("%d ",min(a,(int)vec.size()));
        if(vec.size()>0)
        {

            for(int i=0; i<vec.size() && i<a; i++)
                printf("%d ",vec[i]);
        }
        puts("");

        vec1.clear(),vec2.clear();

    }
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
int n, m, q;
vector<int> a[101001];
priority_queue<int, vector<int>, greater<int>> Lca[100011][21];
int P[100011][21];
priority_queue<int, vector<int>, greater<int>> val[100101];
int h[100011];
priority_queue<int, vector<int>, greater<int>> update(priority_queue<int, vector<int>, greater<int>> a, priority_queue<int, vector<int>, greater<int>> b)
{
    while (b.size())
    {
        a.push(b.top());
        b.pop();
    }
    while (a.size() > 10)
        a.pop();
    return a;
}
void dfs(int u, int par)
{
    for (auto v : a[u])
    {
        if (v == par)
            continue;
        Lca[v][0] = update(Lca[v][0], val[u]);
        P[v][0] = u;
        h[v] = h[u] + 1;
        dfs(v, u);
    }
}
priority_queue<int, vector<int>, greater<int>> ans;
void Get(int u, int v)
{
    if (h[u] < h[v])
        swap(u, v);
    ans = update(ans, val[u]);
    for (int k = 20; k >= 0; k--)
    {
        int x = P[u][k];
        if (h[x] >= h[v])
        {
            ans = update(ans, Lca[u][k]);
            u = x;
        }
    }
    if (u == v)
    {
        return;
    }
    ans = update(ans, val[v]);
    for (int k = 20; k >= 0; k--)
    {
        int ru = P[u][k];
        int rv = P[v][k];
        if (ru != rv)
        {
            ans = update(ans, Lca[u][k]);
            ans = update(ans, Lca[v][k]);
            u = ru;
            v = rv;
        }
    }
    ans = update(ans, Lca[u][0]);
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        val[x].push(i);
    }
    h[0] = -1;
    dfs(1, 0);
    for (int j = 1; j <= 20; j++)
    {
        for (int i = 1; i <= n; i++)
        {
            int par = P[i][j - 1];
            P[i][j] = P[par][j - 1];
            Lca[i][j] = update(Lca[i][j - 1], Lca[par][j - 1]);
        }
    }
    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;
        Get(u, v);
        int x = ans.size();
        cout << min(a, x) << " ";
        while (a-- && ans.size())
        {
            cout << ans.top() << " ";
            ans.pop();
        }
        cout << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
int n, m, q;
vector<int> a[101001];
priority_queue<int, vector<int>, greater<int>> Lca[100011][21];
int P[100011][21];
priority_queue<int, vector<int>, greater<int>> val[100101];
int h[100011];
priority_queue<int, vector<int>, greater<int>> update(priority_queue<int, vector<int>, greater<int>> a, priority_queue<int, vector<int>, greater<int>> b)
{
    while (b.size())
    {
        a.push(b.top());
        b.pop();
    }
    while (a.size() > 10)
        a.pop();
    return a;
}
void dfs(int u, int par)
{
    for (auto v : a[u])
    {
        if (v == par)
            continue;
        Lca[v][0] = update(Lca[v][0], val[u]);
        P[v][0] = u;
        h[v] = h[u] + 1;
        dfs(v, u);
    }
}
priority_queue<int, vector<int>, greater<int>> ans;
void Get(int u, int v)
{
    while (ans.size())
        ans.pop();
    if (h[u] < h[v])
        swap(u, v);
    ans = update(ans, val[u]);
    for (int k = 20; k >= 0; k--)
    {
        int x = P[u][k];
        if (h[x] >= h[v])
        {
            ans = update(ans, Lca[u][k]);
            u = x;
        }
    }
    if (u == v)
    {
        return;
    }
    ans = update(ans, val[v]);
    for (int k = 20; k >= 0; k--)
    {
        int ru = P[u][k];
        int rv = P[v][k];
        if (ru != rv)
        {
            ans = update(ans, Lca[u][k]);
            ans = update(ans, Lca[v][k]);
            u = ru;
            v = rv;
        }
    }
    ans = update(ans, Lca[u][0]);
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        val[x].push(i);
        if (val[x].size() > 10)
            val[x].pop();
    }
    h[0] = -1;
    dfs(1, 0);
    for (int j = 1; j <= 20; j++)
    {
        for (int i = 1; i <= n; i++)
        {
            int par = P[i][j - 1];
            P[i][j] = P[par][j - 1];
            Lca[i][j] = update(Lca[i][j - 1], Lca[par][j - 1]);
        }
    }
    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;
        Get(u, v);
        int x = ans.size();
        cout << min(a, x) << " ";
        while (a-- && ans.size())
        {
            cout << ans.top() << " ";
            ans.pop();
        }
        cout << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
int n, m, q;
vector<int> a[101001];
priority_queue<int, vector<int>, greater<int>> Lca[100011][21];
int P[100011][21];
priority_queue<int, vector<int>, greater<int>> val[100101];
int h[100011];
priority_queue<int, vector<int>, greater<int>> update(priority_queue<int, vector<int>, greater<int>> a, priority_queue<int, vector<int>, greater<int>> b)
{
    while (b.size())
    {
        a.push(b.top());
        b.pop();
    }
    while (a.size() > 10)
        a.pop();
    return a;
}
void dfs(int u, int par)
{
    for (auto v : a[u])
    {
        if (v == par)
            continue;
        Lca[v][0] = update(Lca[v][0], val[u]);
        P[v][0] = u;
        h[v] = h[u] + 1;
        dfs(v, u);
    }
}
priority_queue<int, vector<int>, greater<int>> ans;
void Get(int u, int v)
{
    while (ans.size())
        ans.pop();
    if (h[u] < h[v])
        swap(u, v);
    ans = update(ans, val[u]);
    for (int k = 20; k >= 0; k--)
    {
        int x = P[u][k];
        if (h[x] >= h[v])
        {
            ans = update(ans, Lca[u][k]);
            u = x;
        }
    }
    if (u == v)
    {
        return;
    }
    ans = update(ans, val[v]);
    for (int k = 20; k >= 0; k--)
    {
        int ru = P[u][k];
        int rv = P[v][k];
        if (ru != rv)
        {
            ans = update(ans, Lca[u][k]);
            ans = update(ans, Lca[v][k]);
            u = ru;
            v = rv;
        }
    }
    ans = update(ans, Lca[u][0]);
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        val[x].push(i);
    }
    h[0] = -1;
    dfs(1, 0);
    for (int j = 1; j <= 20; j++)
    {
        for (int i = 1; i <= n; i++)
        {
            int par = P[i][j - 1];
            P[i][j] = P[par][j - 1];
            Lca[i][j] = update(Lca[i][j - 1], Lca[par][j - 1]);
        }
    }
    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;
        Get(u, v);
        int x = ans.size();
        cout << min(a, x) << " ";
        while (a-- && ans.size())
        {
            cout << ans.top() << " ";
            ans.pop();
        }
        cout << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
int n, m, q;
vector<int> a[101001];
priority_queue<int> Lca[100011][21];
int P[100011][21];
priority_queue<int> val[100101];
int h[100011];
priority_queue<int> update(priority_queue<int> a, priority_queue<int> b)
{
    while (b.size())
    {
        a.push(b.top());
        b.pop();
    }
    while (a.size() > 10)
        a.pop();
    return a;
}
void dfs(int u, int par)
{
    for (auto v : a[u])
    {
        if (v == par)
            continue;
        Lca[v][0] = update(Lca[v][0], val[u]);
        P[v][0] = u;
        h[v] = h[u] + 1;
        dfs(v, u);
    }
}
priority_queue<int> ans;
void debug(priority_queue<int> h)
{
    while (h.size())
    {
        cout << h.top() << " ";
        h.pop();
    }
}
void Get(int u, int v)
{
    while (ans.size())
        ans.pop();
    if (h[u] < h[v])
        swap(u, v);
    ans = update(ans, val[u]);
    for (int k = 20; k >= 0; k--)
    {
        int x = P[u][k];
        if (h[x] >= h[v])
        {
            ans = update(ans, Lca[u][k]);
            u = x;
        }
    }
    if (u == v)
    {
        return;
    }
    ans = update(ans, val[v]);
    for (int k = 20; k >= 0; k--)
    {
        int ru = P[u][k];
        int rv = P[v][k];
        if (ru != rv)
        {
            ans = update(ans, Lca[u][k]);
            ans = update(ans, Lca[v][k]);
            u = ru;
            v = rv;
        }
    }
    ans = update(ans, Lca[u][0]);
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        val[x].push(i);
        if (val[x].size() > 10)
            val[x].pop();
    }
    //debug(val[3]);
    h[0] = -1;
    dfs(1, 0);
    for (int j = 1; j <= 20; j++)
    {
        for (int i = 1; i <= n; i++)
        {
            int par = P[i][j - 1];
            P[i][j] = P[par][j - 1];
            Lca[i][j] = update(Lca[i][j - 1], Lca[par][j - 1]);
        }
    }
    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;
        Get(u, v);
        int x = ans.size();
        int k = min(x, a);
        cout << k << " ";
        vector<int> A;
        while (ans.size())
        {
            A.push_back(ans.top());
            ans.pop();
        }
        reverse(A.begin(), A.end());
        int cnt = 0;
        while (k--)
        {
            cout << A[cnt] << " ";
            ++cnt;
        }
        cout << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
int n, m, q;
vector<int> a[101001];
priority_queue<int, vector<int>, greater<int>> Lca[100011][21];
int P[100011][21];
int val[100101];
int h[100011];
priority_queue<int, vector<int>, greater<int>> update(priority_queue<int, vector<int>, greater<int>> a, priority_queue<int, vector<int>, greater<int>> b)
{
    while (b.size())
    {
        a.push(b.top());
        b.pop();
    }
    while (a.size() > 10)
        a.pop();
    return a;
}
void dfs(int u, int par)
{
    for (auto v : a[u])
    {
        if (v == par)
            continue;
        if (val[u])
            Lca[v][0].push(val[u]);
        P[v][0] = u;
        h[v] = h[u] + 1;
        dfs(v, u);
    }
}
priority_queue<int, vector<int>, greater<int>> ans;
void Get(int u, int v)
{
    if (h[u] < h[v])
        swap(u, v);
    if (val[u])
        ans.push(val[u]);
    for (int k = 20; k >= 0; k--)
    {
        int x = P[u][k];
        if (h[x] >= h[v])
        {
            ans = update(ans, Lca[u][k]);
            u = x;
        }
    }
    if (u == v)
    {
        return;
    }
    if (val[v])
        ans.push(val[v]);
    for (int k = 20; k >= 0; k--)
    {
        int ru = P[u][k];
        int rv = P[v][k];
        if (ru != rv)
        {
            ans = update(ans, Lca[u][k]);
            ans = update(ans, Lca[v][k]);
            u = ru;
            v = rv;
        }
    }
    ans = update(ans, Lca[u][0]);
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for (int i = 1; i <= m; i++)
        cin >> val[i];
    h[0] = -1;
    dfs(1, 0);
    for (int j = 1; j <= 20; j++)
    {
        for (int i = 1; i <= n; i++)
        {
            int par = P[i][j - 1];
            P[i][j] = P[par][j - 1];
            Lca[i][j] = update(Lca[i][j - 1], Lca[par][j - 1]);
        }
    }
    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;
        Get(u, v);
        int x = ans.size();
        cout << min(a, x) << " ";
        while (a-- && ans.size())
        {
            cout << ans.top() << " ";
            ans.pop();
        }
        cout << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
int n, m, q;
vector<int> a[101001];
priority_queue<int, vector<int>, greater<int>> Lca[100011][21];
int P[100011][21];
priority_queue<int, vector<int>, greater<int>> val[100101];
int h[100011];
priority_queue<int, vector<int>, greater<int>> update(priority_queue<int, vector<int>, greater<int>> a, priority_queue<int, vector<int>, greater<int>> b)
{
    while (b.size())
    {
        a.push(b.top());
        b.pop();
    }
    while (a.size() > 10)
        a.pop();
    return a;
}
void dfs(int u, int par)
{
    for (auto v : a[u])
    {
        if (v == par)
            continue;
        Lca[v][0] = update(Lca[v][0], val[u]);
        P[v][0] = u;
        h[v] = h[u] + 1;
        dfs(v, u);
    }
}
priority_queue<int, vector<int>, greater<int>> ans;
void Get(int u, int v)
{
    while (ans.size())
        ans.pop();
    if (h[u] < h[v])
        swap(u, v);
    ans = update(ans, val[u]);
    for (int k = 20; k >= 0; k--)
    {
        int x = P[u][k];
        if (h[x] >= h[v])
        {
            ans = update(ans, Lca[u][k]);
            u = x;
        }
    }
    if (u == v)
    {
        return;
    }
    ans = update(ans, val[v]);
    for (int k = 20; k >= 0; k--)
    {
        int ru = P[u][k];
        int rv = P[v][k];
        if (ru != rv)
        {
            ans = update(ans, Lca[u][k]);
            ans = update(ans, Lca[v][k]);
            u = ru;
            v = rv;
        }
    }
    ans = update(ans, Lca[u][0]);
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        val[x].push(i);
        if (val[x] > 10)
            val[x].pop();
    }
    h[0] = -1;
    dfs(1, 0);
    for (int j = 1; j <= 20; j++)
    {
        for (int i = 1; i <= n; i++)
        {
            int par = P[i][j - 1];
            P[i][j] = P[par][j - 1];
            Lca[i][j] = update(Lca[i][j - 1], Lca[par][j - 1]);
        }
    }
    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;
        Get(u, v);
        int x = ans.size();
        cout << min(a, x) << " ";
        while (a-- && ans.size())
        {
            cout << ans.top() << " ";
            ans.pop();
        }
        cout << "\n";
    }
    return 0;
}


#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define MAXN 101010
#define LOGN 18
#define EPS 1e-8
#define fcin ios_base::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef vector<int> vi;

vi adj[MAXN], vet[MAXN];
int nivel[MAXN], anc[MAXN][LOGN];

struct Node{
	int tt, vet[20];
	Node():tt(0){}
}tds[MAXN*20];
int L[MAXN], R[MAXN], root[MAXN], ptr = 1;

Node merge(Node a, Node b){
	Node c;
	c.tt = a.tt+b.tt;
	rep(i,0,a.tt) c.vet[i] = a.vet[i];
	rep(i,0,b.tt) c.vet[i+a.tt] = b.vet[i];
	sort(c.vet,c.vet+c.tt); c.tt = unique(c.vet,c.vet+c.tt)-c.vet;
	c.tt = min(c.tt,10);
	return c;
}

int upd(int b, int l, int r, int p, vi &v){
	if(r < p || p < l) return b;
	if(l==r){
		tds[ptr].tt = sz(v);
		rep(i,0,sz(v)) tds[ptr].vet[i] = v[i];
		return ptr++;
	}
	int m = (l+r)>>1, fe = upd(L[b], l, m, p, v), fd = upd(R[b], m+1,r,p, v);
	L[ptr] = fe, R[ptr] = fd;
	tds[ptr] = merge(tds[L[ptr]], tds[R[ptr]]);
	return ptr++;
}

Node query(int b, int l, int r, int x, int y){
	if(!b || r < x || y < l) return tds[0];
	if(x <= l && r <= y) return tds[b];
	int m = (l+r)>>1;
	return merge(query(L[b], l, m, x, y),query(R[b], m+1, r, x, y));
}

int n, m, q;

void dfs(int v, int pr){
	sort(all(vet[v]));
	if(sz(vet[v]) > 10) vet[v].resize(10);
	root[v] = upd(root[pr], 0, n, nivel[v], vet[v]);
	rep(i,0,sz(adj[v]))
		if(adj[v][i] != pr) {
			int p = adj[v][i];
			nivel[p] = nivel[v] + 1;
			anc[p][0] = v;
			rep(j,1,LOGN) anc[p][j] = anc[anc[p][j-1]][j-1];
			dfs(p, v);
		}
}

int LCA(int u, int v) {
	if(nivel[u] < nivel[v]) swap(u,v);
	int diff = nivel[u] - nivel[v];
	if(diff) dec(i,LOGN-1,0) if((1<<i) <= diff) u = anc[u][i], diff -= (1<<i);
	if(u == v) return u;
	dec(i,LOGN-1,0) if(anc[u][i] != anc[v][i]) {
		u = anc[u][i];
		v = anc[v][i];
	}
	return anc[u][0];
}

const int bufsz = 10101010;
struct fastio{
	char buf[bufsz], bout[bufsz];
	int cur, cur2;
	fastio(){
		cur = bufsz;
		cur2 = 0;
	}
	inline char nextchar(){
		if(cur==bufsz){
			fread(buf, bufsz, 1, stdin);
			cur=0;
		}
		return buf[cur++];
	}
	inline int nextint(){
		int x = 0;
		char c = nextchar();
		while(!('0' <= c && c <= '9'))
			c = nextchar();
		while('0' <= c && c <= '9'){
			x = x*10+c-'0';
			c = nextchar();
		}
		return x;
	}
	inline void flush(){
		fwrite(bout,cur2,1,stdout);
		cur2 = 0;
	}
	inline void pchar(char c){
		if(cur2==bufsz) flush();
		bout[cur2++]=c;
	}
	inline void pint(int n){
		if(!n){pchar('0'); return;}
		char z[20], *p = &z[19];
		*p = 0;
		while(n){ *--p = '0' + n%10; n/=10; }
		while(*p) pchar(*p++);
	}
}io;

int main() {
	n = io.nextint();
	m = io.nextint();
	q = io.nextint();
	rep(i,1,n){
		int u = io.nextint()-1;
		int v = io.nextint()-1;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	rep(i,0,m){
		int v = io.nextint()-1;
		vet[v].pb(i);
	}
	dfs(0,0);
	while(q--){
		int u, v, a;
		u = io.nextint()-1;
		v = io.nextint()-1;
		a = io.nextint();
		u--, v--;
		int lca = LCA(u,v);
		Node no = query(root[u], 0, n, nivel[lca], nivel[u]);
		no = merge(no, query(root[v], 0, n, nivel[lca], nivel[v]));
		a = min(a,no.tt);
		io.pint(a);
		rep(i,0,a){ io.pchar(' '); io.pint(no.vet[i]+1); }
		io.pchar('\n');
	}
	io.flush();
}


#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define MAXN 101010
#define LOGN 18
#define EPS 1e-8
#define fcin ios_base::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef vector<int> vi;

vi adj[MAXN], vet[MAXN];
int n, m, q, nivel[MAXN], anc[MAXN][LOGN];

struct Node{
	int tt, vet[10];
	Node():tt(0){}
};
void merge(Node& c, Node& a, Node& b){
	int ia = 0, ib = 0; c.tt = 0;
	while(c.tt<10){
		if(ia == a.tt && ib == b.tt) break;
		if(ia < a.tt && ib < b.tt && a.vet[ia] == b.vet[ib]) ia++;
		else if(ia == a.tt || (ib < b.tt && b.vet[ib] < a.vet[ia]))
			c.vet[c.tt++] = b.vet[ib++];
		else c.vet[c.tt++] = a.vet[ia++];
	}
}
void merge(Node &a, Node &b){
	Node c = a;
	merge(a,b,c);
}
Node men[MAXN][LOGN], ori[MAXN];

void dfs(int v, int pr){
	sort(all(vet[v]));
	if(sz(vet[v]) > 10) vet[v].resize(10);
	ori[v].tt = sz(vet[v]);
	rep(i,0,sz(vet[v])) ori[v].vet[i] = vet[v][i];

	rep(i,0,sz(adj[v]))
		if(adj[v][i] != pr) {
			int p = adj[v][i];
			nivel[p] = nivel[v] + 1;
			anc[p][0] = v;
			men[p][0] = ori[v];
			rep(j,1,LOGN)
				anc[p][j] = anc[anc[p][j-1]][j-1],
				merge(men[p][j], men[p][j-1], men[anc[p][j-1]][j-1]);
			dfs(p, v);
		}
}

int LCA(int u, int v) {
	if(nivel[u] < nivel[v]) swap(u,v);
	int diff = nivel[u] - nivel[v];
	if(diff) dec(i,LOGN-1,0) if((1<<i) <= diff) u = anc[u][i], diff -= (1<<i);
	if(u == v) return u;
	dec(i,LOGN-1,0) if(anc[u][i] != anc[v][i]) {
		u = anc[u][i];
		v = anc[v][i];
	}
	return anc[u][0];
}

void sobe(int v, int d, Node & no){
	rep(i,0,LOGN) if(d&(1<<i)){
		merge(no, men[v][i]);
		v = anc[v][i];
	}
}

int main() {
	scanf("%d%d%d", &n, &m, &q);
	rep(i,1,n){
		int u, v;
		scanf("%d%d", &u, &v);
		u--, v--;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	rep(i,0,m){
		int v;
		scanf("%d", &v);
		vet[v-1].pb(i+1);
	}
	dfs(0,0);
	while(q--){
		int u, v, a;
		scanf("%d%d%d", &u, &v, &a);
		int lca = LCA(u,v);
		Node no;
		merge(no, ori[u],ori[v]);
		sobe(u,nivel[u]-nivel[lca],no);
		sobe(v,nivel[v]-nivel[lca],no);
		a = min(a, no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]); printf("\n");
	}
}


#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define MAXN 101010
#define LOGN 18
#define EPS 1e-8
#define fcin ios_base::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef vector<int> vi;

vi adj[MAXN], vet[MAXN];
int n, m, q, nivel[MAXN], anc[MAXN][LOGN];

struct Node{
	int tt, vet[10];
	Node():tt(0){}
};
void merge(Node& c, Node& a, Node& b){
	int ia = 0, ib = 0; c.tt = 0;
	while(c.tt<10){
		if(ia == a.tt && ib == b.tt) break;
		if(ia < a.tt && ib < b.tt && a.vet[ia] == b.vet[ib]) ia++;
		else if(ia == a.tt || (ib < b.tt && b.vet[ib] < a.vet[ia]))
			c.vet[c.tt++] = b.vet[ib++];
		else c.vet[c.tt++] = a.vet[ia++];
	}
}
void merge(Node &a, Node &b){
	Node c = a;
	merge(a,b,c);
}
Node men[MAXN][LOGN], ori[MAXN];

void dfs(int v, int pr){
	sort(all(vet[v]));
	if(sz(vet[v]) > 10) vet[v].resize(10);
	ori[v].tt = sz(vet[v]);
	rep(i,0,sz(vet[v])) ori[v].vet[i] = vet[v][i];

	rep(i,0,sz(adj[v]))
		if(adj[v][i] != pr) {
			int p = adj[v][i];
			nivel[p] = nivel[v] + 1;
			anc[p][0] = v;
			men[p][0] = ori[v];
			rep(j,1,LOGN)
				anc[p][j] = anc[anc[p][j-1]][j-1],
				merge(men[p][j], men[p][j-1], men[anc[p][j-1]][j-1]);
			dfs(p, v);
		}
}

int LCA(int u, int v) {
	if(nivel[u] < nivel[v]) swap(u,v);
	int diff = nivel[u] - nivel[v];
	if(diff) dec(i,LOGN-1,0) if((1<<i) <= diff) u = anc[u][i], diff -= (1<<i);
	if(u == v) return u;
	dec(i,LOGN-1,0) if(anc[u][i] != anc[v][i]) {
		u = anc[u][i];
		v = anc[v][i];
	}
	return anc[u][0];
}

void sobe(int v, int d, Node & no){
	rep(i,0,LOGN) if(d&(1<<i)){
		merge(no, men[v][i]);
		v = anc[v][i];
	}
}

int main() {
	scanf("%d%d%d", &n, &m, &q);
	rep(i,1,n){
		int u, v;
		scanf("%d%d", &u, &v);
		u--, v--;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	rep(i,0,m){
		int v;
		scanf("%d", &v);
		vet[v-1].pb(i+1);
	}
	dfs(0,0);
	while(q--){
		int u, v, a;
		scanf("%d%d%d", &u, &v, &a);
		u--, v--;
		int lca = LCA(u,v);
		Node no;
		merge(no, ori[u],ori[v]);
		sobe(u,nivel[u]-nivel[lca],no);
		sobe(v,nivel[v]-nivel[lca],no);
		a = min(a, no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]); printf("\n");
	}
}