#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*18];
int L[MAXN], R[MAXN], root[MAXN], ptr = 1;

void merge(Node& a, Node& b, Node &c){
	int ia = 0, ib = 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++];
	}
}

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;
	merge(tds[L[ptr]], tds[R[ptr]], tds[ptr]);
	return ptr++;
}

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

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];
}

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);
		v--;
		vet[v].pb(i);
	}
	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;
		query(root[u], 0, n, nivel[lca], nivel[u],no);
		query(root[v], 0, n, nivel[lca], nivel[v],no);
		a = min(a,no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]+1);
		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 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;

void merge(Node& a, Node& b, Node &c){
	int ia = 0, ib = 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++];
	}
}

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;
	merge(tds[L[ptr]], tds[R[ptr]], tds[ptr]);
	return ptr++;
}

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

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];
}

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);
		v--;
		vet[v].pb(i);
	}
	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;
		query(root[u], 0, n, nivel[lca], nivel[u],no);
		query(root[v], 0, n, nivel[lca], nivel[v],no);
		a = min(a,no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]+1);
		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];
	}
}

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;

void printa(Node a){
	printf("%d\n", a.tt);
	rep(i,0,a.tt) printf("%d ", a.vet[i]+1);
	if(a.tt) printf("\n");
}

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();
		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);
		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 base[MAXN], ptr;
int cnum, cid[MAXN], chead[MAXN], posb[MAXN], nodeb[MAXN];
int nivel[MAXN], anc[MAXN][LOGN], subsz[MAXN];

struct Node{
	int tt, vet[22];
	Node():tt(0){}
};

Node st[MAXN*4];

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;
}

void make_tree(int b, int l, int r) {
	if(l == r) {
		sort(all(vet[l]));
		st[b].tt = min(10,sz(vet[l]));
		rep(i,0,st[b].tt) st[b].vet[i] = vet[l][i];
		return;
	}
	int fe = (b<<1), fd = fe | 1, m = (l+r)>>1;
	make_tree(fe, l, m);
	make_tree(fd, m+1, r);
	st[b] = merge(st[fe], st[fd]);
}

Node query_tree(int b, int l, int r, int x, int y) {
	if(r < x || y < l) return Node();
	if(x <= l && r <= y) return st[b];
	int fe = (b<<1), fd = fe | 1, m = (l+r)>>1;
	return merge(query_tree(fe, l, m, x, y),query_tree(fd, m+1, r, x, y));
}

Node query_up(int u, int v) {
	int cu, cv = cid[v];
	Node ret = Node();
	while(1){
		cu = cid[u];
		if(cu == cv){
			ret = merge(ret, query_tree(1, 0, ptr-1, posb[v], posb[u]));
			break;
		}
		ret = merge(ret, query_tree(1, 0, ptr-1, posb[chead[cu]], posb[u]));
		u = chead[cu];
		u = anc[u][0];
	}
	return ret;
}

int LCA(int u, int v) {
	if(nivel[u] < nivel[v]) swap(u,v);
	int diff = nivel[u] - nivel[v];
	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];
}

Node query(int u, int v) {
	int lca = LCA(u, v);
	Node op1 = query_up(u, lca);
	Node op2 = query_up(v, lca);
	return merge(op1,op2);
}

void HLD(int v, int pr) {
	if(chead[cnum] == -1)
		chead[cnum] = v;

	cid[v] = cnum;
	posb[v] = ptr;
	nodeb[ptr] = v;
	base[ptr++] = 0;

	int sc = -1;
	rep(i,0,sz(adj[v])) if(adj[v][i] != pr)
		if(sc == -1 || subsz[sc] < subsz[adj[v][i]])
			sc = adj[v][i];

	if(sc != -1)
		HLD(sc, v);

	rep(i,0,sz(adj[v]))
		if(adj[v][i] != pr && adj[v][i] != sc) {
			cnum++;
			HLD(adj[v][i], v);
		}
}

void dfs(int v, int pr) {
	subsz[v] = 1;
	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);
			subsz[v] += subsz[pr];
		}
}

int main() {
	int n, m, q;
	scanf("%d%d%d", &n, &m, &q);
	rep(i,0,n){
		chead[i] = -1;
		rep(j,0,LOGN) anc[i][j] = -1;
	}
	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);
		v--;
		vet[v].pb(i);
	}
	cnum = 0;
	dfs(0, -1);
	HLD(0, 0);
	make_tree(1, 0, ptr-1);
	while(q--){
		int u, v, a;
		scanf("%d%d%d", &u, &v, &a);
		u--, v--;
		Node no = query(u,v);
		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 base[MAXN], ptr;
int cnum, cid[MAXN], chead[MAXN], posb[MAXN], nodeb[MAXN];
int nivel[MAXN], anc[MAXN][LOGN], subsz[MAXN];

struct Node{
	int tt, vet[22];
	Node():tt(0){}
};

Node st[MAXN*4];

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;
}

void make_tree(int b, int l, int r) {
	if(l == r) {
		sort(all(vet[l]));
		st[b].tt = min(10,sz(vet[nodeb[l]]));
		rep(i,0,st[b].tt) st[b].vet[i] = vet[nodeb[l]][i];
		return;
	}
	int fe = (b<<1), fd = fe | 1, m = (l+r)>>1;
	make_tree(fe, l, m);
	make_tree(fd, m+1, r);
	st[b] = merge(st[fe], st[fd]);
}

Node query_tree(int b, int l, int r, int x, int y) {
	if(r < x || y < l) return Node();
	if(x <= l && r <= y) return st[b];
	int fe = (b<<1), fd = fe | 1, m = (l+r)>>1;
	return merge(query_tree(fe, l, m, x, y),query_tree(fd, m+1, r, x, y));
}

Node query_up(int u, int v) {
	int cu, cv = cid[v];
	Node ret = Node();
	while(1){
		cu = cid[u];
		if(cu == cv){
			ret = merge(ret, query_tree(1, 0, ptr-1, posb[v], posb[u]));
			break;
		}
		ret = merge(ret, query_tree(1, 0, ptr-1, posb[chead[cu]], posb[u]));
		u = chead[cu];
		u = anc[u][0];
	}
	return ret;
}

int LCA(int u, int v) {
	if(nivel[u] < nivel[v]) swap(u,v);
	int diff = nivel[u] - nivel[v];
	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];
}

Node query(int u, int v) {
	int lca = LCA(u, v);
	Node op1 = query_up(u, lca);
	Node op2 = query_up(v, lca);
	return merge(op1,op2);
}

void HLD(int v, int pr) {
	if(chead[cnum] == -1)
		chead[cnum] = v;

	cid[v] = cnum;
	posb[v] = ptr;
	nodeb[ptr] = v;
	base[ptr++] = 0;

	int sc = -1;
	rep(i,0,sz(adj[v])) if(adj[v][i] != pr)
		if(sc == -1 || subsz[sc] < subsz[adj[v][i]])
			sc = adj[v][i];

	if(sc != -1)
		HLD(sc, v);

	rep(i,0,sz(adj[v]))
		if(adj[v][i] != pr && adj[v][i] != sc) {
			cnum++;
			HLD(adj[v][i], v);
		}
}

void dfs(int v, int pr) {
	subsz[v] = 1;
	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);
			subsz[v] += subsz[pr];
		}
}

int main() {
	int n, m, q;
	scanf("%d%d%d", &n, &m, &q);
	rep(i,0,n){
		chead[i] = -1;
		rep(j,0,LOGN) anc[i][j] = -1;
	}
	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);
		v--;
		vet[v].pb(i);
	}
	cnum = 0;
	dfs(0, -1);
	HLD(0, 0);
	make_tree(1, 0, ptr-1);
	while(q--){
		int u, v, a;
		scanf("%d%d%d", &u, &v, &a);
		u--, v--;
		Node no = query(u,v);
		a = min(a,no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]+1);
		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 nivel[MAXN], anc[MAXN][LOGN];

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

void merge(Node& a, Node& b, Node &c){
	int ia = 0, ib = c.tt = 0;
	rep(i,0,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++];
	}
}

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;
	merge(tds[L[ptr]], tds[R[ptr]], tds[ptr]);
	return ptr++;
}

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

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];
}

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);
		v--;
		vet[v].pb(i);
	}
	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;
		query(root[u], 0, n, nivel[lca], nivel[u],no);
		query(root[v], 0, n, nivel[lca], nivel[v],no);
		a = min(a,no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]+1);
		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 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];
}

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);
		v--;
		vet[v].pb(i);
	}
	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 = 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);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]+1);
		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 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();
		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 nivel[MAXN], anc[MAXN][LOGN];

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

void merge(Node& a, Node& b, Node &c){
	int ia = 0, ib = 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++];
	}
}

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;
	merge(tds[L[ptr]], tds[R[ptr]], tds[ptr]);
	return ptr++;
}

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

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);
	assert(ptr < 20*MAXN);
	while(q--){
		int u, v, a;
		u = io.nextint()-1;
		v = io.nextint()-1;
		a = io.nextint();
		int lca = LCA(u,v);
		Node no;
		query(root[u], 0, n, nivel[lca], nivel[u],no);
		query(root[v], 0, n, nivel[lca], nivel[v],no);
		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 nivel[MAXN], anc[MAXN][LOGN];

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

void merge(Node& a, Node& b, Node &c){
	int ia = 0, ib = c.tt = 0;
	rep(i,0,10){
		if(ia == a.tt && ib == b.tt) break;
		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++];
	}
}

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;
	merge(tds[L[ptr]], tds[R[ptr]], tds[ptr]);
	return ptr++;
}

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

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];
}

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);
		v--;
		vet[v].pb(i);
	}
	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;
		query(root[u], 0, n, nivel[lca], nivel[u],no);
		query(root[v], 0, n, nivel[lca], nivel[v],no);
		a = min(a,no.tt);
		printf("%d", a);
		rep(i,0,a) printf(" %d", no.vet[i]+1);
		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 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;

void merge(Node& a, Node& b, Node &c){
	int ia = 0, ib = 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++];
	}
}

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;
	merge(tds[L[ptr]], tds[R[ptr]], tds[ptr]);
	return ptr++;
}

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

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);
	assert(ptr < 20*MAXN);
	while(q--){
		int u, v, a;
		u = io.nextint()-1;
		v = io.nextint()-1;
		a = io.nextint();
		int lca = LCA(u,v);
		Node no;
		query(root[u], 0, n, nivel[lca], nivel[u],no);
		query(root[v], 0, n, nivel[lca], nivel[v],no);
		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>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+2;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>> &v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+1;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>>v){
    for(int i = 0;i < sz(v);i++) st[i][0] = v[i];

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }
}

vector<int> tree_query(int l, int r){
    vector<int>res;

    int j = (int)log2(r-l+1);
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);

    return res;
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        vector<int>v = tree_query(pos[head[a]], pos[a]);
        for(int x:v) res.pb(x);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    vector<int>v = tree_query(pos[a], pos[b]);
    for(int x:v) res.pb(x);

    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

// Testando minha implementação de treap
struct treap{
private:
    struct node{
        int key, prior;
        node *l = nullptr, *r = nullptr;
        int cnt = 1;

        node(int k) : key(k), prior(rand()) {}
    };

    node *t = nullptr;

    int cnt(node *n){
        return n?n->cnt:0;
    }

    void upd_cnt(node *n){
        if (n) n->cnt = 1+cnt(n->l)+cnt(n->r);
    }

    void split(node *root, int key, node *&l, node *&r){
        if (!root) l = r = nullptr;
        else if (key <= root->key){
            r = root;
            split(root->l, key, l, root->l);
        }
        else{
            l = root;
            split(root->r, key, root->r, r);
        }

        upd_cnt(l);
        upd_cnt(r);
    }

    void insert(node *&root, node *element){
        if (!root) return void(root = element);

        if (element->prior > root->prior){
            split(root, element->key, element->l, element->r);
            root = element;
        }
        else{
            if (element->key < root->key) insert(root->l, element);
            else insert(root->r, element);
        }

        upd_cnt(root);
    }

    void merge(node *&root, node *l, node *r){
        if (!r || !l) root = l?l:r;
        else if (l->prior > r->prior){
            root = l;
            merge(l->r, l->r, r);
        }
        else{
            root = r;
            merge(r->l, l, r->l);
        }

        upd_cnt(root);
    }

    void erase(node *&root, int key){
        if (!root) return;
        if (root->key == key) {
            node *aux = root;
            merge(root, root->l, root->r);
            delete aux;
        }
        else{
            if (key < root->key) erase(root->l, key);
            else erase(root->r, key);
        }

        upd_cnt(root);
    }

    void del(node *n){
        if (!n) return;
        del(n->l);
        del(n->r);
        delete n;
    }

    /* ==================== EXTRA ==================== */
    int kth(node *root, int pos){ // O(log(N))
        if (!root) return 0;

        int p = 1+cnt(root->l);
        if (p == pos) return root->key;

        if (p > pos) return kth(root->l, pos);
        else return kth(root->r, pos-p);
    }

    node *unite(node *l, node *r){ // O(M*log(N/M))
        if (!l || !r) return l?l:r;
        if (l->prior < r->prior) swap(l, r);
        node *tl;
        node *tr;
        split(r, l->key, tl, tr);
        l->l = unite(l->l, tl);
        l->r = unite(l->r, tr);

        upd_cnt(l);
        return l;
    }

    void print(node *n){
        if (!n) return;
        print(n->l);
        cout << n->key << " ";
        print(n->r);
    }

public:
    void insert(int key){
        insert(t, new node(key));
    }

    void erase(int key){
        erase(t, key);
    }

    ~treap(){
        del(t);
    }

    /* ==================== EXTRA ==================== */
    bool find(int key){
        node *aux = t;
        while(aux && aux->key != key){
            if (key < aux->key) aux = aux->l;
            else aux = aux->r;
        }
        return aux != nullptr;
    }

    int order_of_key(int key){
        int res = 0;

        node *l = nullptr, *r = nullptr;
        split(t, key, l, r);
        res = cnt(l);

        merge(t, l, r);
        return res;
    }

    void erase_range(int l, int r){
        node *tl = nullptr, *tr = nullptr, *aux = nullptr;
        split(t, l, tl, aux);
        split(aux, r+1, aux, tr);
        del(aux);
        merge(t, tl, tr);
    }

    int kth(int pos){
        return kth(t, pos+1);
    }

    void unite(treap &b){
        t = unite(t, b.t);
        b.t = nullptr;
    }

    int size(){
        return cnt(t);
    }

    void print(){
        print(t);
        cout << endl;
    }
};

void fix_size(treap *a){
    while(a->size() > 10) a->erase(a->kth(10));
}

void add_treap(treap *a, treap *b){
    if (b == nullptr) return;

    for(int j = 0;j < b->size();j++){
        a->insert(b->kth(j));
    }

    fix_size(a);
}

int n, m, q;

struct hld{
    vector<vector<int>>adj;
    vector<int> parent, depth, heavy, head, pos;
    vector<treap*>tree;
    int curr_pos = 1;

    hld(){
        adj.resize(n+7);
        parent.resize(n+7);
        depth.resize(n+7);
        heavy.resize(n+7);
        head.resize(n+7);
        pos.resize(n+7);
        tree.resize(4*n+7, nullptr);

        for(int i = 0;i < sz(tree);i++){
            tree[i] = new treap();
        }
    }

    ~hld(){
        for(int i = 0;i < sz(tree);i++){
            if (tree[i] != nullptr) delete tree[i];
        }
    }

    void update(int i, int x, int node = 1, int tl = 0, int tr = n){
        if (tl > i || tr < i) return;
        if (tl == tr && tl == i) {
            tree[node]->insert(x);
            fix_size(tree[node]);
            return;
        }
        int mid = (tl+tr)/2;
        update(i, x, node*2, tl, mid);
        update(i, x, node*2+1, mid+1, tr);
        add_treap(tree[node], tree[node*2]);
        add_treap(tree[node], tree[node*2+1]);
    };

    treap *tree_query(int l, int r, int node = 1, int tl = 0, int tr = n){
        if (l > r) return nullptr;
        if (tl == l && tr == r) {
            treap *tmp = new treap();
            add_treap(tmp, tree[node]);
            return tmp;
        }
        int mid = (tl+tr)/2;
        treap *left = tree_query(l, min(r, mid), node*2, tl, mid);
        treap *right = tree_query(max(mid+1, l), r, node*2+1, mid+1, tr);

        treap *res = new treap();
        add_treap(res, left);
        add_treap(res, right);

        delete left;
        delete right;

        return res;
    }

    int dfs(int a){
        int size = 1;
        int max_csize = 0;

        for(int b:adj[a]){
            if (b == parent[a]) continue;
            parent[b] = a;
            depth[b] = depth[a]+1;

            int csize = dfs(b);
            size += csize;
            if (csize > max_csize){
                max_csize = csize;
                heavy[a] = b;
            }
        }

        return size;
    }

    void decompose(int a, int h){
        head[a] = h;
        pos[a] = curr_pos++;

        if (heavy[a] != 0) decompose(heavy[a], h);
        for(int b:adj[a]){
            if (b == heavy[a] || b == parent[a]) continue;
            decompose(b, b);
        }
    }

    treap *query(int a, int b){
        treap *res = new treap();

        while(head[a] != head[b]){
            if (depth[head[a]] < depth[head[b]]) swap(a, b);

            treap *tmp = tree_query(pos[head[a]], pos[a]);
            add_treap(res, tmp);
            delete tmp;

            a = parent[head[a]];
        }

        if (pos[a] > pos[b]) swap(a, b);

        treap *tmp = tree_query(pos[a], pos[b]);
        add_treap(res, tmp);
        delete tmp;

        return res;
    }

};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    hld h = hld();

    _fi(n-1){
        int a, b;cin>>a>>b;
        h.adj[a].pb(b);
        h.adj[b].pb(a);
    }

    h.dfs(1);
    h.decompose(1, 1);

    _fi(m){
        int c;cin>>c;
        h.update(h.pos[c], i+1);
    }

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        treap *t = h.query(a, b);

        int s = min(t->size(), k);
        cout << s << " ";
        for(int j = 0;j < s;j++) cout << t->kth(j) << " ";
        cout << endl;

        delete t;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+1;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>>v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }
}

void tree_query(vector<int>&res, int l, int r){
    int j = (int)log2(r-l+1);
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);
        fix_size(res);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5+7;
int const maxnlog = (int)log2(maxn)+5;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>> &v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+2;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>>v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);
        fix_size(res);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

void fix_size(vector<int> &s){
    sort(all(s));
    if (sz(s) > 10) s.resize(10);
}

vector<int> merge(const vector<int>&a, const vector<int>&b){
    vector<int>res;

    for(int x:a) res.pb(x);
    for(int x:b) res.pb(x);
    fix_size(res);

    return res;
}

int n, m, q;

struct hld{
    vector<vector<int>>adj;
    vector<int> parent, depth, heavy, head, pos;
    vector<vector<int>>tree;
    int curr_pos = 1;

    hld(){
        adj.resize(n+7);
        parent.resize(n+7);
        depth.resize(n+7);
        heavy.resize(n+7);
        head.resize(n+7);
        pos.resize(n+7);
        tree.resize(4*n+7);
    }

    void update(int i, int x, int node = 1, int tl = 0, int tr = n){
        if (tl > i || tr < i) return;
        if (tl == tr && tl == i) {
            tree[node].pb(x);
            fix_size(tree[node]);
            return;
        }
        int mid = (tl+tr)/2;
        update(i, x, node*2, tl, mid);
        update(i, x, node*2+1, mid+1, tr);

        tree[node] = merge(tree[node*2], tree[node*2+1]);
    };

    vector<int> tree_query(int l, int r, int node = 1, int tl = 0, int tr = n){
        if (l > r) return {};
        if (tl == l && tr == r) return tree[node];
        int mid = (tl+tr)/2;
        vector<int> left = tree_query(l, min(r, mid), node*2, tl, mid);
        vector<int> right = tree_query(max(mid+1, l), r, node*2+1, mid+1, tr);
        return merge(left, right);
    }

    int dfs(int a){
        int size = 1;
        int max_csize = 0;

        for(int b:adj[a]){
            if (b == parent[a]) continue;
            parent[b] = a;
            depth[b] = depth[a]+1;

            int csize = dfs(b);
            size += csize;
            if (csize > max_csize){
                max_csize = csize;
                heavy[a] = b;
            }
        }

        return size;
    }

    void decompose(int a, int h){
        head[a] = h;
        pos[a] = curr_pos++;

        if (heavy[a] != 0) decompose(heavy[a], h);
        for(int b:adj[a]){
            if (b == heavy[a] || b == parent[a]) continue;
            decompose(b, b);
        }
    }

    vector<int> query(int a, int b){
        vector<int> res;

        while(head[a] != head[b]){
            if (depth[head[a]] < depth[head[b]]) swap(a, b);

            vector<int>v = tree_query(pos[head[a]], pos[a]);
            for(int x:v) res.pb(x);

            a = parent[head[a]];
        }

        if (pos[a] > pos[b]) swap(a, b);

        vector<int>v = tree_query(pos[a], pos[b]);
        for(int x:v) res.pb(x);

        fix_size(res);

        return res;
    }

};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    hld h = hld();

    _fi(n-1){
        int a, b;cin>>a>>b;
        h.adj[a].pb(b);
        h.adj[b].pb(a);
    }

    h.dfs(1);
    h.decompose(1, 1);

    _fi(m){
        int c;cin>>c;
        h.update(h.pos[c], i+1);
    }

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> v = h.query(a, b);
        int s = min(sz(v), k);

        cout << s << " ";
        for(int j = 0;j < s;j++) cout << v[j] << " " ;
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

void fix_size(set<int> &s){
    while(sz(s) > 10) s.erase(*s.rbegin());
}

set<int> merge_set(const set<int>&a, const set<int>&b){
    set<int> res;

    for(int x:a) res.insert(x);
    for(int x:b) res.insert(x);
    fix_size(res);

    return res;
}

void add_set(set<int>&a, const set<int>&b){
    for(int x:b) a.insert(x);
    fix_size(a);
}

int n, m, q;

struct hld{
    vector<vector<int>>adj;
    vector<int> parent, depth, heavy, head, pos;
    vector<set<int>>tree;
    int curr_pos = 1;

    hld(){
        adj.resize(n+7);
        parent.resize(n+7);
        depth.resize(n+7);
        heavy.resize(n+7);
        head.resize(n+7);
        pos.resize(n+7);
        tree.resize(4*n+7);
    }

    void update(int i, int x, int node = 1, int tl = 0, int tr = n){
        if (tl > i || tr < i) return;
        if (tl == tr && tl == i) {
            tree[node].insert(x);
            fix_size(tree[node]);
            return;
        }
        int mid = (tl+tr)/2;
        update(i, x, node*2, tl, mid);
        update(i, x, node*2+1, mid+1, tr);

        tree[node] = merge_set(tree[node*2], tree[node*2+1]);
    };

    set<int> tree_query(int l, int r, int node = 1, int tl = 0, int tr = n){
        if (l > r) return {};
        if (tl == l && tr == r) return tree[node];
        int mid = (tl+tr)/2;
        set<int> left = tree_query(l, min(r, mid), node*2, tl, mid);
        set<int> right = tree_query(max(mid+1, l), r, node*2+1, mid+1, tr);
        return merge_set(left, right);
    }

    int dfs(int a){
        int size = 1;
        int max_csize = 0;

        for(int b:adj[a]){
            if (b == parent[a]) continue;
            parent[b] = a;
            depth[b] = depth[a]+1;

            int csize = dfs(b);
            size += csize;
            if (csize > max_csize){
                max_csize = csize;
                heavy[a] = b;
            }
        }

        return size;
    }

    void decompose(int a, int h){
        head[a] = h;
        pos[a] = curr_pos++;

        if (heavy[a] != 0) decompose(heavy[a], h);
        for(int b:adj[a]){
            if (b == heavy[a] || b == parent[a]) continue;
            decompose(b, b);
        }
    }

    set<int> query(int a, int b){
        set<int> res;

        while(head[a] != head[b]){
            if (depth[head[a]] < depth[head[b]]) swap(a, b);
            add_set(res, tree_query(pos[head[a]], pos[a]));
            a = parent[head[a]];
        }

        if (pos[a] > pos[b]) swap(a, b);
        add_set(res, tree_query(pos[a], pos[b]));

        return res;
    }

};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    hld h = hld();

    _fi(n-1){
        int a, b;cin>>a>>b;
        h.adj[a].pb(b);
        h.adj[b].pb(a);
    }

    h.dfs(1);
    h.decompose(1, 1);

    _fi(m){
        int c;cin>>c;
        h.update(h.pos[c], i+1);
    }

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        set<int> st = h.query(a, b);

        int s = min(sz(st), k);
        cout << s << " ";
        for(int x:st) {
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+2;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>>v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        // fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);
        fix_size(res);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+1;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>> &v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

void fix_size(vector<int> &s){
    sort(all(s));
    if (sz(s) > 10) s.resize(10);
}

vector<int> merge(const vector<int>&a, const vector<int>&b){
    vector<int>res;

    for(int x:a) res.pb(x);
    for(int x:b) res.pb(x);
    fix_size(res);

    return res;
}

int n, m, q;

struct hld{
    vector<vector<int>>adj;
    vector<int> parent, depth, heavy, head, pos;
    vector<vector<int>>tree;
    int curr_pos = 1;

    hld(){
        adj.resize(n+7);
        parent.resize(n+7);
        depth.resize(n+7);
        heavy.resize(n+7);
        head.resize(n+7);
        pos.resize(n+7);
        tree.resize(4*n+7);
    }

    void update(int i, int x, int node = 1, int tl = 0, int tr = n){
        if (tl > i || tr < i) return;
        if (tl == tr && tl == i) {
            tree[node].pb(x);
            fix_size(tree[node]);
            return;
        }
        int mid = (tl+tr)/2;
        update(i, x, node*2, tl, mid);
        update(i, x, node*2+1, mid+1, tr);

        tree[node] = merge(tree[node*2], tree[node*2+1]);
    };

    vector<int> tree_query(int l, int r, int node = 1, int tl = 0, int tr = n){
        if (l > r) return {};
        if (tl == l && tr == r) return tree[node];
        int mid = (tl+tr)/2;
        vector<int> left = tree_query(l, min(r, mid), node*2, tl, mid);
        vector<int> right = tree_query(max(mid+1, l), r, node*2+1, mid+1, tr);
        return merge(left, right);
    }

    int dfs(int a){
        int size = 1;
        int max_csize = 0;

        for(int b:adj[a]){
            if (b == parent[a]) continue;
            parent[b] = a;
            depth[b] = depth[a]+1;

            int csize = dfs(b);
            size += csize;
            if (csize > max_csize){
                max_csize = csize;
                heavy[a] = b;
            }
        }

        return size;
    }

    void decompose(int a, int h){
        head[a] = h;
        pos[a] = curr_pos++;

        if (heavy[a] != 0) decompose(heavy[a], h);
        for(int b:adj[a]){
            if (b == heavy[a] || b == parent[a]) continue;
            decompose(b, b);
        }
    }

    vector<int> query(int a, int b){
        vector<int> res;

        while(head[a] != head[b]){
            if (depth[head[a]] < depth[head[b]]) swap(a, b);

            vector<int>v = tree_query(pos[head[a]], pos[a]);
            for(int x:v) res.pb(x);

            a = parent[head[a]];
        }

        if (pos[a] > pos[b]) swap(a, b);

        vector<int>v = tree_query(pos[a], pos[b]);
        for(int x:v) res.pb(x);

        return res;
    }

};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    hld h = hld();

    _fi(n-1){
        int a, b;cin>>a>>b;
        h.adj[a].pb(b);
        h.adj[b].pb(a);
    }

    h.dfs(1);
    h.decompose(1, 1);

    _fi(m){
        int c;cin>>c;
        h.update(h.pos[c], i+1);
    }

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> v = h.query(a, b);
        int s = min(sz(v), k);

        cout << s << " ";
        for(int j = 0;j < s;j++) cout << v[j] << " " ;
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+1;
int n, m, q;
set<int> st[maxn+7][maxnlog+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(set<int> &s){
    while (sz(s) > 10) s.erase(*s.rbegin());
}

set<int> merge(const set<int>&a, const set<int>&b){
    set<int>res;

    for(int x:a) res.insert(x);
    for(int x:b) res.insert(x);
    fix_size(res);

    return res;
}

void build(const vector<set<int>>v){
    for(int i = 0;i < sz(v);i++) st[i][0] = v[i];

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            st[i][j] = merge(st[i][j-1], st[i+(1<<(j-1))][j-1]);
        }
    }
}

set<int> tree_query(int l, int r){
    int j = (int)log2(r-l+1);
    return merge(st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

set<int> query(int a, int b){
    set<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        set<int>v = tree_query(pos[head[a]], pos[a]);
        for(int x:v) res.insert(x);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    set<int>v = tree_query(pos[a], pos[b]);
    for(int x:v) res.insert(x);

    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<set<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].insert(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        set<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

// Testando minha implementação de treap
struct treap{
private:
    struct node{
        int key, prior;
        node *l = nullptr, *r = nullptr;
        int cnt = 1;

        node(int k) : key(k), prior(rand()) {}
    };

    node *t = nullptr;

    int cnt(node *n){
        return n?n->cnt:0;
    }

    void upd_cnt(node *n){
        if (n) n->cnt = 1+cnt(n->l)+cnt(n->r);
    }

    void split(node *root, int key, node *&l, node *&r){
        if (!root) l = r = nullptr;
        else if (key <= root->key){
            r = root;
            split(root->l, key, l, root->l);
        }
        else{
            l = root;
            split(root->r, key, root->r, r);
        }

        upd_cnt(l);
        upd_cnt(r);
    }

    void insert(node *&root, node *element){
        if (!root) return void(root = element);

        if (element->prior > root->prior){
            split(root, element->key, element->l, element->r);
            root = element;
        }
        else{
            if (element->key < root->key) insert(root->l, element);
            else insert(root->r, element);
        }

        upd_cnt(root);
    }

    void merge(node *&root, node *l, node *r){
        if (!r || !l) root = l?l:r;
        else if (l->prior > r->prior){
            root = l;
            merge(l->r, l->r, r);
        }
        else{
            root = r;
            merge(r->l, l, r->l);
        }

        upd_cnt(root);
    }

    void erase(node *&root, int key){
        if (!root) return;
        if (root->key == key) {
            node *aux = root;
            merge(root, root->l, root->r);
            delete aux;
        }
        else{
            if (key < root->key) erase(root->l, key);
            else erase(root->r, key);
        }

        upd_cnt(root);
    }

    void del(node *n){
        if (!n) return;
        del(n->l);
        del(n->r);
        delete n;
    }

    /* ==================== EXTRA ==================== */
    int kth(node *root, int pos){ // O(log(N))
        if (!root) return 0;

        int p = 1+cnt(root->l);
        if (p == pos) return root->key;

        if (p > pos) return kth(root->l, pos);
        else return kth(root->r, pos-p);
    }

    node *unite(node *l, node *r){ // O(M*log(N/M))
        if (!l || !r) return l?l:r;
        if (l->prior < r->prior) swap(l, r);
        node *tl;
        node *tr;
        split(r, l->key, tl, tr);
        l->l = unite(l->l, tl);
        l->r = unite(l->r, tr);

        upd_cnt(l);
        return l;
    }

    void print(node *n){
        if (!n) return;
        print(n->l);
        cout << n->key << " ";
        print(n->r);
    }

public:
    void insert(int key){
        insert(t, new node(key));
    }

    void erase(int key){
        erase(t, key);
    }

    ~treap(){
        del(t);
    }

    /* ==================== EXTRA ==================== */
    bool find(int key){
        node *aux = t;
        while(aux && aux->key != key){
            if (key < aux->key) aux = aux->l;
            else aux = aux->r;
        }
        return aux != nullptr;
    }

    int order_of_key(int key){
        int res = 0;

        node *l = nullptr, *r = nullptr;
        split(t, key, l, r);
        res = cnt(l);

        merge(t, l, r);
        return res;
    }

    void erase_range(int l, int r){
        node *tl = nullptr, *tr = nullptr, *aux = nullptr;
        split(t, l, tl, aux);
        split(aux, r+1, aux, tr);
        del(aux);
        merge(t, tl, tr);
    }

    int kth(int pos){
        return kth(t, pos+1);
    }

    void unite(treap &b){
        t = unite(t, b.t);
        b.t = nullptr;
    }

    int size(){
        return cnt(t);
    }

    void print(){
        print(t);
        cout << endl;
    }
};

void fix_size(treap *a){
    while(a->size() > 10) a->erase(a->kth(10));
}

void add_treap(treap *a, treap *b){
    if (b == nullptr) return;

    for(int j = 0;j < b->size();j++){
        a->insert(b->kth(j));
    }

    fix_size(a);
}

int n, m, q;

struct hld{
    vector<vector<int>>adj;
    vector<int> parent, depth, heavy, head, pos;
    vector<treap*>tree;
    int curr_pos = 1;

    hld(){
        adj.resize(n+7);
        parent.resize(n+7);
        depth.resize(n+7);
        heavy.resize(n+7);
        head.resize(n+7);
        pos.resize(n+7);
        tree.resize(4*n+7, nullptr);

        for(int i = 0;i < sz(tree);i++){
            tree[i] = new treap();
        }
    }

    ~hld(){
        for(int i = 0;i < sz(tree);i++){
            if (tree[i] != nullptr) delete tree[i];
        }
    }

    void update(int i, int x, int node = 1, int tl = 0, int tr = n){
        if (tl > i || tr < i) return;
        if (tl == tr && tl == i) {
            tree[node]->insert(x);
            fix_size(tree[node]);
            return;
        }
        int mid = (tl+tr)/2;
        update(i, x, node*2, tl, mid);
        update(i, x, node*2+1, mid+1, tr);

        delete tree[node];
        tree[node] = new treap();

        add_treap(tree[node], tree[node*2]);
        add_treap(tree[node], tree[node*2+1]);
    };

    treap *tree_query(int l, int r, int node = 1, int tl = 0, int tr = n){
        if (l > r) return nullptr;
        if (tl == l && tr == r) {
            treap *tmp = new treap();
            add_treap(tmp, tree[node]);
            return tmp;
        }
        int mid = (tl+tr)/2;
        treap *left = tree_query(l, min(r, mid), node*2, tl, mid);
        treap *right = tree_query(max(mid+1, l), r, node*2+1, mid+1, tr);

        treap *res = new treap();
        add_treap(res, left);
        add_treap(res, right);

        delete left;
        delete right;

        return res;
    }

    int dfs(int a){
        int size = 1;
        int max_csize = 0;

        for(int b:adj[a]){
            if (b == parent[a]) continue;
            parent[b] = a;
            depth[b] = depth[a]+1;

            int csize = dfs(b);
            size += csize;
            if (csize > max_csize){
                max_csize = csize;
                heavy[a] = b;
            }
        }

        return size;
    }

    void decompose(int a, int h){
        head[a] = h;
        pos[a] = curr_pos++;

        if (heavy[a] != 0) decompose(heavy[a], h);
        for(int b:adj[a]){
            if (b == heavy[a] || b == parent[a]) continue;
            decompose(b, b);
        }
    }

    treap *query(int a, int b){
        treap *res = new treap();

        while(head[a] != head[b]){
            if (depth[head[a]] < depth[head[b]]) swap(a, b);

            treap *tmp = tree_query(pos[head[a]], pos[a]);
            add_treap(res, tmp);
            delete tmp;

            a = parent[head[a]];
        }

        if (pos[a] > pos[b]) swap(a, b);

        treap *tmp = tree_query(pos[a], pos[b]);
        add_treap(res, tmp);
        delete tmp;

        return res;
    }

};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    hld h = hld();

    _fi(n-1){
        int a, b;cin>>a>>b;
        h.adj[a].pb(b);
        h.adj[b].pb(a);
    }

    h.dfs(1);
    h.decompose(1, 1);

    _fi(m){
        int c;cin>>c;
        h.update(h.pos[c], i+1);
    }

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        treap *t = h.query(a, b);

        int s = min(t->size(), k);
        cout << s << " ";
        for(int j = 0;j < s;j++) cout << t->kth(j) << " ";
        cout << endl;

        delete t;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5;
int const maxnlog = (int)log2(maxn)+2;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 10) v.resize(10);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>> &v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn+1;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()

#define hash sodnf9843bsd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

int const maxn = 1e5+7;
int const maxnlog = (int)log2(maxn)+5;
int n, m, q;
vector<int> st[maxn+7][maxnlog+7] = {};
int log_[maxn+7] = {};
vector<int>adj[maxn+7];
int parent[maxn+7] = {};
int depth[maxn+7] = {};
int heavy[maxn+7] = {};
int head[maxn+7] = {};
int pos[maxn+7] = {};
int curr_pos = 1;

void fix_size(vector<int> &v){
    sort(all(v));
    v.resize(unique(all(v))-v.begin());
    if (sz(v) > 13) v.resize(13);
}

void add_set(vector<int>&src, const vector<int>&a, const vector<int>&b){
    for(int x:a) src.pb(x);
    for(int x:b) src.pb(x);
}

void build(const vector<vector<int>> &v){
    for(int i = 0;i < sz(v);i++) {
        st[i][0] = v[i];
        fix_size(st[i][0]);
    }

    for(int j = 1;j <= maxnlog;j++){
        for(int i = 0;i+(1<<j) <= maxn;i++){
            add_set(st[i][j], st[i][j-1], st[i+(1<<(j-1))][j-1]);
            fix_size(st[i][j]);
        }
    }

    log_[1] = 0;
    for(int i = 2;i <= maxn;i++) log_[i] = log_[i/2]+1;
}

void tree_query(vector<int>&res, int l, int r){
    int j = log_[r-l+1];
    add_set(res, st[l][j], st[r-(1<<j)+1][j]);
}

int dfs(int a){
    int size = 1;
    int max_csize = 0;

    for(int b:adj[a]){
        if (b == parent[a]) continue;
        parent[b] = a;
        depth[b] = depth[a]+1;

        int csize = dfs(b);
        size += csize;
        if (csize > max_csize){
            max_csize = csize;
            heavy[a] = b;
        }
    }

    return size;
}

void decompose(int a, int h){
    head[a] = h;
    pos[a] = curr_pos++;

    if (heavy[a] != 0) decompose(heavy[a], h);
    for(int b:adj[a]){
        if (b == heavy[a] || b == parent[a]) continue;
        decompose(b, b);
    }
}

vector<int> query(int a, int b){
    vector<int> res;

    while(head[a] != head[b]){
        if (depth[head[a]] < depth[head[b]]) swap(a, b);

        tree_query(res, pos[head[a]], pos[a]);

        a = parent[head[a]];
    }

    if (pos[a] > pos[b]) swap(a, b);

    tree_query(res, pos[a], pos[b]);
    fix_size(res);

    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m>>q;

    _fi(n-1){
        int a, b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    dfs(1);
    decompose(1, 1);

    vector<vector<int>>v(n+1);
    _fi(m){
        int c;cin>>c;
        v[pos[c]].pb(i+1);
    }
    build(v);

    _fi(q){
        int a, b, k;cin>>a>>b>>k;

        vector<int> ans = query(a, b);
        int s = min(sz(ans), k);

        cout << s << " ";
        for(int x:ans){
            s--;
            cout << x << " ";
            if (s == 0) break;
        }
        cout << endl;
    }

    return 0;
}