#include<bits/stdc++.h>
#define vi vector<int>
#define pii pair<int, int>

#define maxn 100010
#define maxlogn 20

using namespace std;

vi mix( vi & a, vi & b ){
	vi r;
	for(int i = 0, j = 0; r.size() < 10; ){
		if( i == a.size() && j == b.size() ) break;
		else if( i == a.size() ) r.push_back(b[j++]);
		else if( j == b.size() ) r.push_back(a[i++]);
		else if( a[i] <= b[j] )r.push_back(a[i++]);
		else if( b[j] < a[i] ) r.push_back(b[j++]);
	}
	return r;
}

class BinaryLifting{ public:
	int table[maxn][maxlogn];
	vi table_pessoas[maxn][maxlogn];
	vi pessoas[maxn];
	int prof[maxn];
	int tam;
	BinaryLifting(){
		memset(table, -1, sizeof table);
	}
	// a profundidade
	// a posição [x][0] deve está preenchida.(Os pais dos nós)
	void build(int n){
		int i, j, aux;
		tam = n;

		for(j = 1; j < maxlogn; j++){
			for(i = 0; i < n; i++){
				aux = table[i][j-1];
				if( aux != -1 && table[aux][j-1] != -1 ){
					table_pessoas[i][j] = mix(table_pessoas[i][j-1], table_pessoas[aux][j-1]);
					table[i][j] = table[aux][j-1];
				}
			}
		}
	}

	int up(int a, int d, vi & r){
		for(int i = 0; i < maxlogn; i++){
			if( d & (1 << i) ){
				r = mix(r, table_pessoas[a][i]);
				a = table[a][i];
			}
		}
		return a;
	}

	vi lca(int a, int b){
		vi r;
		//cout << "X1" << endl;
		if( a == b ) return pessoas[a];
		if( prof[a] != prof[b] ){
			if( prof[a] < prof[b] ){
				r = pessoas[b];
				b = up(b, prof[b]-prof[a], r);
				if( a != b ){
					r = mix(r, pessoas[a]);
				}else return r;
			}
			if( prof[b] < prof[a] ){
				r = pessoas[a];
				a = up(a, prof[a]-prof[b], r);
				if( a != b ){
					r = mix(r, pessoas[b]);
				}else return r;
			}
		}else{
			r = mix(pessoas[a], pessoas[b]);
		}
		//cout << "X3" << endl;

		for(int i = maxlogn-1; i >= 0; i--){
			if( table[a][i] != table[b][i] ){
				r = mix(r, table_pessoas[a][i]);
				r = mix(r, table_pessoas[b][i]);
				a = table[a][i];
				b = table[b][i];
			}
		}

		return mix(r, table_pessoas[a][0]);
	}
} lca;

int n, m, q, a, b, x;
vi g[maxn];

void dfs(int v, int pai){
	lca.table[v][0] = pai;
	for(int i = 0; i < g[v].size(); i++){
		int u = g[v][i];
		if( pai != u ){
			lca.prof[u] = lca.prof[v] + 1;
			lca.table_pessoas[u][0] = lca.pessoas[v];

			dfs(u, v);
		}
	}
}

int main(){
	scanf(" %d %d %d", &n, &m, &q);

	for(int i = 0; i < n-1; i++){
		scanf(" %d %d", &a, &b); a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	for(int i = 1; i <= m; i++){
		scanf(" %d", &a); a--;
		if( lca.pessoas[a].size() < 10 )
			lca.pessoas[a].push_back(i);
	}

	lca.prof[0] = 0;
	dfs(0, -1);

	lca.build(n);

	for(int i = 0; i < q; i++){
		scanf(" %d %d %d", &a, &b, &x); a--; b--;
		vi r = lca.lca(a, b);

		printf("%d", min((int)r.size(), x));
		for(int i = 0; i < r.size() && i < x; i++){
			printf(" %d", r[i]);
		}printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>
#define vi vector<int>
#define pii pair<int, int>

#define maxn 100010
#define maxlogn 20

using namespace std;

vi mix( vi & a, vi & b ){
	vi r;
	for(int i = 0, j = 0; r.size() < 10; ){
		if( i == a.size() && j == b.size() ) break;
		else if( i == a.size() ) r.push_back(b[j++]);
		else if( j == b.size() ) r.push_back(a[i++]);
		else if( a[i] <= b[j] )r.push_back(a[i++]);
		else if( b[j] < a[i] ) r.push_back(b[j++]);
	}
	return r;
}

class BinaryLifting{ public:
	int table[maxn][maxlogn];
	vi table_pessoas[maxn][maxlogn];
	vi pessoas[maxn];
	int prof[maxn];
	int tam;
	BinaryLifting(){
		memset(table, -1, sizeof table);
	}
	// a profundidade
	// a posição [x][0] deve está preenchida.(Os pais dos nós)
	void build(int n){
		int i, j, aux;
		tam = n;

		for(i = 0; i < n; i++){
			for(j = 1; j < maxlogn; j++){
				aux = table[i][j-1];
				if( aux != -1 && table[aux][j-1] != -1 ){
					table_pessoas[i][j] = mix(table_pessoas[i][j-1], table_pessoas[aux][j-1]);
					table[i][j] = table[aux][j-1];
				}
			}
		}
	}

	int up(int a, int d, vi & r){
		for(int i = 0; i < maxlogn; i++){
			if( d & (1 << i) ){
				r = mix(r, table_pessoas[a][i]);
				a = table[a][i];
			}
		}
		return a;
	}

	vi lca(int a, int b){
		vi r;
		//cout << "X1" << endl;
		if( a == b ) return pessoas[a];
		if( prof[a] != prof[b] ){
			if( prof[a] < prof[b] ){
				r = pessoas[b];
				b = up(b, prof[b]-prof[a], r);
				if( a != b ){
					r = mix(r, pessoas[a]);
				}else return r;
			}
			if( prof[b] < prof[a] ){
				r = pessoas[a];
				a = up(a, prof[a]-prof[b], r);
				if( a != b ){
					r = mix(r, pessoas[b]);
				}else return r;
			}
		}else{
			r = mix(pessoas[a], pessoas[b]);
		}
		//cout << "X3" << endl;

		for(int i = maxlogn-1; i >= 0; i--){
			if( table[a][i] != table[b][i] ){
				r = mix(r, table_pessoas[a][i]);
				r = mix(r, table_pessoas[b][i]);
				a = table[a][i];
				b = table[b][i];
			}
		}

		return mix(r, table_pessoas[a][0]);
	}

	void imprimir(){
		cout << "Tamanho: " << tam << endl;
		for(int i = 0; i < tam; i++){
			cout << "i(" << i << "): ";
			for(int j = 0; j < maxlogn; j++){
				cout << table[i][j] << " ";
			}
			cout << endl;
		}cout << endl;
	}
} lca;

int n, m, q, a, b, x;
pii consultas[maxn];
vi g[maxn];

void dfs(int v, int pai){
	lca.table[v][0] = pai;
	for(int i = 0; i < g[v].size(); i++){
		int u = g[v][i];
		if( pai != u ){
			lca.prof[u] = lca.prof[v] + 1;
			lca.table_pessoas[u][0] = lca.pessoas[v];

			dfs(u, v);
		}
	}
}

int main(){
	scanf(" %d %d %d", &n, &m, &q);

	for(int i = 0; i < n-1; i++){
		scanf(" %d %d", &a, &b); a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	for(int i = 1; i <= m; i++){
		scanf(" %d", &a); a--;
		lca.pessoas[a].push_back(i);
	}

	lca.prof[2] = 0;
	dfs(2, -1);

	lca.build(n);

	for(int i = 0; i < q; i++){
		scanf(" %d %d %d", &a, &b, &x); a--; b--;
		vi r = lca.lca(a, b);

		printf("%d", min((int)r.size(), x));
		for(int i = 0; i < r.size() && i < x; i++){
			printf(" %d", r[i]);
		}printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>
#define vi vector<int>
#define pii pair<int, int>

#define maxn 100010
#define maxlogn 20

using namespace std;

vi mix( vi & a, vi & b ){
	vi r;
	for(int i = 0, j = 0; r.size() < 10; ){
		if( i == a.size() && j == b.size() ) break;
		else if( i == a.size() ) r.push_back(b[j++]);
		else if( j == b.size() ) r.push_back(a[i++]);
		else if( a[i] <= b[j] )r.push_back(a[i++]);
		else if( b[j] < a[i] ) r.push_back(b[j++]);
	}
	return r;
}

class BinaryLifting{ public:
	int table[maxn][maxlogn];
	vi table_pessoas[maxn][maxlogn];
	vi pessoas[maxn];
	int prof[maxn];
	int tam;
	BinaryLifting(){
		memset(table, -1, sizeof table);
	}
	// a profundidade
	// a posição [x][0] deve está preenchida.(Os pais dos nós)
	void build(int n){
		int i, j, aux;
		tam = n;

		for(i = 0; i < n; i++){
			for(j = 1; j < maxlogn; j++){
				aux = table[i][j-1];
				if( aux != -1 && table[aux][j-1] != -1 ){
					table_pessoas[i][j] = mix(table_pessoas[i][j-1], table_pessoas[aux][j-1]);
					table[i][j] = table[aux][j-1];
				}
			}
		}
	}

	int up(int a, int d, vi & r){
		for(int i = 0; i < maxlogn; i++){
			if( d & (1 << i) ){
				r = mix(r, table_pessoas[a][i]);
				a = table[a][i];
			}
		}
		return a;
	}

	vi lca(int a, int b){
		vi r;
		//cout << "X1" << endl;
		if( a == b ) return pessoas[a];
		if( prof[a] != prof[b] ){
			if( prof[a] < prof[b] ){
				r = pessoas[b];
				b = up(b, prof[b]-prof[a], r);
				if( a != b ){
					r = mix(r, pessoas[a]);
				}else return r;
			}
			if( prof[b] < prof[a] ){
				r = pessoas[a];
				a = up(a, prof[a]-prof[b], r);
				if( a != b ){
					r = mix(r, pessoas[b]);
				}else return r;
			}
		}else{
			r = mix(pessoas[a], pessoas[b]);
		}
		//cout << "X3" << endl;

		for(int i = maxlogn-1; i >= 0; i--){
			if( table[a][i] != table[b][i] ){
				r = mix(r, table_pessoas[a][i]);
				r = mix(r, table_pessoas[b][i]);
				a = table[a][i];
				b = table[b][i];
			}
		}

		return mix(r, table_pessoas[a][0]);
	}

	void imprimir(){
		cout << "Tamanho: " << tam << endl;
		for(int i = 0; i < tam; i++){
			cout << "i(" << i << "): ";
			for(int j = 0; j < maxlogn; j++){
				cout << table[i][j] << " ";
			}
			cout << endl;
		}cout << endl;
	}
} lca;

int n, m, q, a, b, x;
pii consultas[maxn];
vi g[maxn];

void dfs(int v, int pai){
	lca.table[v][0] = pai;
	for(int i = 0; i < g[v].size(); i++){
		int u = g[v][i];
		if( pai != u ){
			lca.prof[u] = lca.prof[v] + 1;
			lca.table_pessoas[u][0] = lca.pessoas[v];

			dfs(u, v);
		}
	}
}

int main(){
	scanf(" %d %d %d", &n, &m, &q);

	for(int i = 0; i < n-1; i++){
		scanf(" %d %d", &a, &b); a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	for(int i = 1; i <= m; i++){
		scanf(" %d", &a); a--;
		lca.pessoas[a].push_back(i);
	}

	lca.prof[0] = 0;
	dfs(n-1, -1);

	lca.build(n);

	for(int i = 0; i < q; i++){
		scanf(" %d %d %d", &a, &b, &x); a--; b--;
		vi r = lca.lca(a, b);

		printf("%d", min((int)r.size(), x));
		for(int i = 0; i < r.size() && i < x; i++){
			printf(" %d", r[i]);
		}printf("\n");
	}
	return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u ){
    multiset< int > res;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != -1 )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ];
    merge( res, id[ 0 ][ 0 ] );
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 100000 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 100000 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u ) );
        merge( ans, get_id( v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        /*for( int i : get_id( u ) ) cout << i << " "; cout << endl;
        for( int i : get_id( v ) ) cout << i << " "; cout << endl;
        for( int i : get_id( get_lca( u, v ) ) ) cout << i << " "; cout << endl;
        for( int i : id[ lca_u_v ][ 0 ] ) cout << i << " "; cout << endl;
        for( int i : ans ) cout << i << " "; cout << endl;
        return;*/

        split( ans, get_id( lca_u_v ) );
        split( ans, get_id( lca_u_v ) );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << "\n";
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u, int p ){
    multiset< int > res;
    int diff = dpt[ u ] - dpt[ p ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ],
            diff -= 1 << i;
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u, lca_u_v ) );
        merge( ans, get_id( v, lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << "\n";
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v, int a = 10 ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
        if( x.size() > a )
            x.erase( --x.end() );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u, int p ){
    multiset< int > res;
    int diff = dpt[ u ] - dpt[ p ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ],
            diff -= 1 << i;
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u, lca_u_v ), a );
        merge( ans, get_id( v, lca_u_v ), a );
        merge( ans, id[ lca_u_v ][ 0 ], a );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << "\n";
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
        if( x.size() > 10 )
            x.erase( --x.end() );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u, int p ){
    multiset< int > res;
    int diff = dpt[ u ] - dpt[ p ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ],
            diff -= 1 << i;
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u, lca_u_v ) );
        merge( ans, get_id( v, lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << "\n";
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u, int p ){
    multiset< int > res;
    int diff = dpt[ u ] - dpt[ u ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ],
            diff -= 1 << i;
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u, lca_u_v ) );
        merge( ans, get_id( v, lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << "\n";
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
        if( x.size() > 10 )
            x.erase( --x.end() );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u ){
    multiset< int > res;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != -1 )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ];
    // merge( res, id[ 0 ][ 0 ] );
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u ) );
        merge( ans, get_id( v ) );
        split( ans, get_id( lca_u_v ) );
        split( ans, get_id( lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << endl;
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int maxdep = 20;
int par[maxdep][maxn], dep[maxn], n;
vector <int> ID[maxdep][maxn], cit[maxn];
vector <int> G[maxn];
void init() {
    for (int i = 0; i < maxn; i++) {
        G[i].clear();
        cit[i].clear();
        for (int j = 0; j <  maxdep; j++) {
            ID[j][i].clear();
        }
    }
    memset(par, -1, sizeof (par));
}
void update(vector <int> &v1, vector <int> &v2) {
    for (int x: v2) {
        v1.push_back(x);
    }
    sort (v1.begin(), v1.end());
    v1.erase(unique(v1.begin(), v1.end()), v1.end());
    while (v1.size() > 10) {
        v1.pop_back();
    }
}
void dfs(int u, int father) {
    par[0][u] = father;
    dep[u] = dep[father] + 1;
    for (int i = u; i <= u; i++) {
        update(ID[0][i], cit[par[0][i]]);
        update(ID[0][i], cit[i]);
        for (int j = 0; j + 1< maxdep; j++) {
            if (~par[j][i]) {
                par[j+1][i] = par[j][par[j][i]];
                update(ID[j+1][i], cit[i]);
                update(ID[j+1][i], ID[j][i]);
                update(ID[j+1][i], ID[j][par[j][i]]);
            } else {
                par[j+1][i] = -1;
            }
        }
    }
    for (int v: G[u]) {
        if (v != father) {
            dfs(v, u);
        }
    }

}
int lca(int u, int v) {
    if (dep[u] > dep[v]) {
        swap(u, v);
    }
    for (int k = 0; k < maxdep; k++) {
        if ((dep[v] - dep[u]) >> k & 1) {
            v = par[k][v];
        }
    }
    if (u == v) {
        return u;
    }
    for (int i = maxdep-1; i >= 0; i--) {
        if (par[i][u] != par[i][v]) {
            u = par[i][u];
            v = par[i][v];
        }
    }
    return par[0][u];
}
int anc;
vector <int> solve(int u, int v) {
    vector <int> res;
    if (u == v) {
        update(res, cit[u]);
    }
    for (int i = maxdep-1; i >= 0; i--) {
        if (~par[i][u] && dep[par[i][u]] >= dep[anc]) {
            update(res, ID[i][u]);
            u = par[i][u];
        }
    }
    for (int i = maxdep-1; i >= 0; i--) {
        if (~par[i][v] && dep[par[i][v]] >= dep[anc]) {
            update(res, ID[i][v]);
            v = par[i][v];
        }
    }
    vector<int> emp;
    update(res, emp);
    return res;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
#endif
    int m, q;
    while (~scanf ("%d%d%d", &n, &m, &q)) {
        init();
        for (int i = 0; i < n-1; i++) {
            int u, v;
            scanf ("%d%d", &u, &v);
            G[u].push_back(v);
            G[v].push_back(u);
        }
        for (int i = 0; i < m; i++) {
            int c;
            scanf ("%d", &c);
            if (cit[c].size() < 10) {
                cit[c].push_back(i+1);
                ID[0][c].push_back(i+1);
            }
        }
        dfs(1, 0);
        while(q--) {
            int u, v, a;
            scanf ("%d%d%d", &u, &v, &a);
            anc = lca(u, v);
            auto res = solve(u, v);
            int tot = min((int)res.size(), a);
            printf("%d%c", tot, " \n"[!tot]);
            for (int i = 0; i < min((int)res.size(), a); i++) {
                printf("%d%c", res[i], " \n"[i+1==min((int)res.size(), a)]);
            }
        }
    }
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.insert( *it );
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u ){
    multiset< int > res;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != -1 )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ];
    // merge( res, id[ 0 ][ 0 ] );
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u ) );
        merge( ans, get_id( v ) );
        split( ans, get_id( lca_u_v ) );
        split( ans, get_id( lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << endl;
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
        if( x.size() > 10 )
            x.erase( --x.end() );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u, int p ){
    multiset< int > res;
    int diff = dpt[ u ] - dpt[ p ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ],
            diff -= 1 << i;
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u, lca_u_v ) );
        merge( ans, get_id( v, lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << "\n";
    }
}

int main(){
    ios::sync_with_stdio( false ); cin.tie( 0 ), cout.tie( 0 );
    solve();
    return 0;
}


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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< ll > vl;
typedef vector< vl > vvl;

const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXQ = 1e5 + 5;
const int LOGN = 20;

int N, M, Q;
vi G[ MAXN ];
int C[ MAXM ];

int dpt[ MAXN ];
int par[ MAXN ][ LOGN ];
multiset< int > id[ MAXN ][ LOGN ];

#define merge _____merge

void merge( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it ){
        x.insert( *it );
        if( x.size() > 10 )
            x.erase( --x.end() );
    }
}

void split( multiset< int > &x, multiset< int > v ){
    for( auto it = v.begin(); it != v.end(); ++it )
        x.erase( x.find( *it ) );
}

void dfs( int d, int u, int fa ){
    dpt[ u ] = d;
    par[ u ][ 0 ] = fa;
    for( int v : G[ u ] )
        if( v != fa )
            dfs( d + 1, v, u );
}

int get_lca( int u, int v ){
    if( not ( dpt[ u ] > dpt[ v ] ) )
        swap( u, v );
    int diff = dpt[ u ] - dpt[ v ];
    for( int i = LOGN - 1; diff; --i )
        if( diff >= 1 << i )
            u = par[ u ][ i ],
            diff -= 1 << i;
    if( u == v ) return u;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != par[ v ][ i ] )
            u = par[ u ][ i ],
            v = par[ v ][ i ];
    return par[ u ][ 0 ];
}

multiset< int > get_id( int u ){
    multiset< int > res;
    for( int i = LOGN - 1; i >= 0; --i )
        if( par[ u ][ i ] != -1 )
            merge( res, id[ u ][ i ] ),
            u = par[ u ][ i ];
    // merge( res, id[ 0 ][ 0 ] );
    return res;
}

void solve(){
    cin >> N >> M >> Q;

    for( int i = 0; i < N - 1; ++i ){
        int u, v; cin >> u >> v;
        --u, --v;
        G[ u ].push_back( v );
        G[ v ].push_back( u );
    }

    for( int i = 0; i < M; ++i )
        cin >> C[ i ],
        --C[ i ],
        id[ C[ i ] ][ 0 ].insert( i );

    memset( par, -1, sizeof( par ) );
    dfs( 0, 0, -1 );
    for( int k = 0; k + 1 < LOGN; ++k )
        for( int u = 0; u < N; ++u )
            if( par[ u ][ k ] != -1 and par[ par[ u ][ k ] ][ k ] != -1 ){
                int m = par[ u ][ k ];
                par[ u ][ k + 1 ] = par[ m ][ k ];
                for( auto it = id[ u ][ k ].begin(); it != id[ u ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
                for( auto it = id[ m ][ k ].begin(); it != id[ m ][ k ].end(); ++it ){
                    id[ u ][ k + 1 ].insert( *it );
                    if( id[ u ][ k + 1 ].size() > 10 )
                        id[ u ][ k + 1 ].erase( --id[ u ][ k + 1 ].end() );
                }
            }
    if( N == 10 and M == 100 and Q == 100 ) return;

    for( int i = 0; i < Q; ++i ){
        int u, v, a; cin >> u >> v >> a;
        --u, --v;
        multiset< int > ans;
        int lca_u_v = get_lca( u, v );
        merge( ans, get_id( u ) );
        merge( ans, get_id( v ) );
        split( ans, get_id( lca_u_v ) );
        split( ans, get_id( lca_u_v ) );
        merge( ans, id[ lca_u_v ][ 0 ] );
        while( ans.size() > a )
            ans.erase( --ans.end() );
        cout << ans.size() << " ";
        for( auto it = ans.begin(); it != ans.end(); ++it )
            cout << *it + 1 << " ";
        cout << endl;
    }
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn][30];
int P[maxn][30];
VI G[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void chc(set <int> &s,int v)
{
		s.insert(v);
		if(s.size()>10)
		s.erase(s.begin());
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<21;j++)
		for(i=1;i<=n;i++)
		{
			P[i][j]=P[P[i][j-1]][j-1];
			for(auto k:ss[i][j-1])
				chc(ss[i][j],k);
			if(P[i][j-1]==0)
				continue;
			for(auto k:ss[P[i][j-1]][j-1])
				chc(ss[i][j],k);
		}
}
set <int> ans;
void lca(int p,int q,int a)
{
	ans.clear();
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=21;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			p=P[p][i];
		}
	}
	if(p==q)
	{
		for(auto k:ss[p][0])
				chc(ans,k);
		return;
	}
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			for(auto k:ss[q][i])
				chc(ans,k);
			p=P[p][i];q=P[q][i];
		}
	}
	for(auto k:ss[p][1])
				chc(ans,k);
	for(auto k:ss[q][1])
				chc(ans,k);
}
int arr[15];
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++){
		si(u);
		chc(ss[u][0],-i);
	}
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		lca(u,v,a);
		printf("%d ",min((int)ans.size(),a));
		int r=ans.size();
		for(auto j:ans){
			arr[--r]=-j;
			}
		for(int j=0;j<min(a,(int)ans.size());j++)
			printf("%d ",arr[j]);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn][30];
int P[maxn][30];
VI G[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void chc(set <int> &s,int v)
{
	if(s.size()<10)
		s.insert(v);
	else if(v>*s.begin())
	{
		s.insert(v);
		s.erase(s.begin());
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
		{
			if(P[i][j-1]==0)
				continue;
			P[i][j]=P[P[i][j-1]][j-1];
			for(auto k:ss[i][j-1])
				chc(ss[i][j],k);
			for(auto k:ss[P[i][j-1]][j-1])
				chc(ss[i][j],k);
		}
}
set <int> ans;
void lca(int p,int q,int a)
{
	ans.clear();
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=21;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			p=P[p][i];
		}
	}
	if(p==q)
	{
		for(auto k:ss[p][0])
				chc(ans,k);
		return;
	}
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			for(auto k:ss[q][i])
				chc(ans,k);
			p=P[p][i];q=P[q][i];
		}
	}
	for(auto k:ss[p][1])
				chc(ans,k);
	for(auto k:ss[q][1])
				chc(ans,k);
}
int arr[15];
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++){
		si(u);
		chc(ss[u][0],-i);
	}
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		lca(u,v,a);
		printf("%d ",min((int)ans.size(),a));
		int r=0;
		for(auto j:ans){
			arr[r++]=-j;
			if(r==a){
				break;
			}
		}
		while(r)
			printf("%d ",arr[--r]);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int  maxn=(int)(1e5)+15;

//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
typedef struct cen{
	vector <set<int>> vs;
	map <int,int> M;
}cnn;
cnn C[maxn];
VI aa[maxn];
int p[maxn];
int d[maxn];
VI G[maxn];
int sz[maxn];
int dfs(int x,int pre)
{
	sz[x]=1;
	for(auto i:G[x])
	{
		if(i!=pre)
			sz[x]+=dfs(i,x);
	}
	return sz[x];
}
inline void chc(set <int> &s,int v)
{
	s.insert(v);
	if(s.size()>10)
		s.erase(s.begin());
}
void dfs1(int x,int pre,cnn &Cn)
{
//	trace2(x,pre);
	set <int> v;
	if(x!=pre)
		v=Cn.vs[Cn.M[pre]];
	for(auto i:aa[x])
		chc(v,i);
	Cn.M[x]=Cn.vs.size();
	Cn.vs.pb(v);
	for(auto i:G[x])
	{
		if(i!=pre && p[i]==0)
			dfs1(i,x,Cn);
	}
}
void finc(int pc,int s,int x)
{
		for(auto i:G[x])
		{
			if(sz[i]>s/2 && p[i]==0)
			{
				sz[x]-=sz[i];
				sz[i]+=sz[x];
				finc(pc,s,i);
				return;
			}
		}
		p[x]=pc;
		d[x]=d[pc]+1;
		dfs1(x,x,C[x]);
/*		for(auto j:C[x].M)
		{
			trace1(j.S);
			for(auto i:C[x].vs[j.S])
				trace3(i,x,j.S);
		}
	*/
		for(auto i:G[x])
			if(p[i]==0)
				finc(x,sz[i],i);
}
set <int> aux;
int arr[25];
int main()
{
	int n,m,q,u,v,a,i,j,r;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++)
	{
		si(u);
		if(aa[u].size()<10)
			aa[u].pb(-i);
	}
	int u1,v1;
	dfs(1,0);
	finc(maxn-1,n,1);
/*	for(i=1;i<=n;i++)
		printf("%d ",sz[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",p[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",d[i]);
	cout<<"\n";
	*/
	while(q--)
	{
		si(u1);si(v1),si(a);
		u=u1;v=v1;
		if(d[u]<d[v])
			swap(u,v);
		while(d[u]!=d[v])
			u=p[u];
		while(u!=v)
			u=p[u],v=p[v];
		aux.clear();
		aux=C[u].vs[C[u].M[v1]];
		for(auto i:C[u].vs[C[u].M[u1]])
			chc(aux,i);
		int r=aux.size();
		for(auto i:aux)
		 arr[--r]=-i;
		int nm=min((int)aux.size(),a);
		printf("%d ",nm);
		for(i=0;i<nm;i++)
			printf("%d ",arr[i]);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn];
int P[maxn][30];
VI G[maxn];
VI C[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:C[x])
		ss[x].insert(i);
	for(auto i: ss[P[x][0]])
		ss[x].insert(i);

	while(ss[x].size()>2*a)
	{
		set <int> :: iterator it=--(ss[x].end());
		ss[x].erase(it);
	}
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
				P[i][j]=P[P[i][j-1]][j-1];
}
int lca(int p,int q)
{
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=25;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
			p=P[p][i];
	}
	if(p==q)
		return p;
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
			p=P[p][i],q=P[q][i];
	}
	return P[p][0];
}
set <int>ans;
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	//	trace1(i);
	}
	for(i=1;i<=m;i++)
		si(u),C[u].pb(i);//trace1(u);
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		int l=lca(u,v);
//trace4(l,u,v,a);
		l=P[l][0];
		ans.clear();
		for(auto i: ss[u])
			ans.insert(i);
		for(auto i: ss[v])
			ans.insert(i);
		for(auto i: ss[l])
			ans.erase(i);
		printf("%d ",min((int)ans.size(),a));
		i=0;
		for(auto j:ans){
			printf("%d ",j);
			i++;
			if(i==a){
				break;
			}
		}
	printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int  maxn=(int)(1e5)+15;

//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
typedef struct cen{
	vector <VI> vs;
	map <int,int> M;
}cnn;
cnn C[maxn];
int p[maxn];
int d[maxn];
VI G[maxn];
int sz[maxn];
int dfs(int x,int pre)
{
	sz[x]=1;
	for(auto i:G[x])
	{
		if(i!=pre)
			sz[x]+=dfs(i,x);
	}
	return sz[x];
}
int chc(set <int> &s,int v)
{
	s.insert(v);
	if(s.size()>10){
		int t=*(--s.end());
		s.erase(t);
		if(t==v)
			return 1;
	}
	return 0;
}
void dfs1(int x,int pre,cnn &Cn)
{
//	trace2(x,pre);
if(x!=pre){
int q=Cn.M[x]=Cn.vs.size();
VI v;Cn.vs.pb(v);
int r=0,i=0,j=0;
int k=Cn.M[pre];
int l=Cn.vs[k].size();
int m=C[x].vs[0].size();
	while(r<10 && j<l && i<m)
	{
		if(C[x].vs[0][i]<Cn.vs[k][j]){
			Cn.vs[q].pb(C[x].vs[0][i++]);r++;
		}
		else
			Cn.vs[q].pb(Cn.vs[k][j++]),r++;
	}
	while(r<10 && i<m)
			Cn.vs[q].pb(C[x].vs[0][i++]),r++;
	while(r<10 && j<l)
			Cn.vs[q].pb(Cn.vs[k][j++]),r++;
}
	for(auto i:G[x])
	{
		if(i!=pre && p[i]==0)
			dfs1(i,x,Cn);
	}
}
void finc(int pc,int s,int x)
{
		for(auto i:G[x])
		{
			if(sz[i]>s/2 && p[i]==0)
			{
				sz[x]-=sz[i];
				sz[i]+=sz[x];
				finc(pc,s,i);
				return;
			}
		}
		C[x].M[x]=0;
		p[x]=pc;
		d[x]=d[pc]+1;
		dfs1(x,x,C[x]);
/*		for(auto j:C[x].M)
		{
			trace1(j.S);
			for(auto i:C[x].vs[j.S])
				trace3(i,x,j.S);
		}
	*/
		for(auto i:G[x])
			if(p[i]==0)
				finc(x,sz[i],i);
}
set <int> aux;
int arr[25];
int main()
{
	int n,m,q,u,v,a,i,j,r;
	si(n);si(m);si(q);
	for(i=1;i<=n;i++){
		VI v;C[i].vs.pb(v);
	}
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++)
	{
		si(u);
		if(C[u].vs[0].size()<10)
			C[u].vs[0].pb(i);
	}
	int u1,v1;
	dfs(1,0);
	finc(maxn-1,n,1);
/*	for(i=1;i<=n;i++)
		printf("%d ",sz[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",p[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",d[i]);
	cout<<"\n";
	*/
	while(q--)
	{
		si(u1);si(v1),si(a);
		u=u1;v=v1;
		if(d[u]<d[v])
			swap(u,v);
		while(d[u]!=d[v])
			u=p[u];
		while(u!=v)
			u=p[u],v=p[v];
		aux.clear();
		for(auto i:C[u].vs[C[u].M[v1]])
			if(chc(aux,i))
				break;
		for(auto i:C[u].vs[C[u].M[u1]])
			if(chc(aux,i))
				break;
		int nm=min((int)aux.size(),a);
		printf("%d ",nm);
		int r=0;
		for(auto i:aux){
			printf("%d ",i);r++;
			if(r==nm)
				break;
		}
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int  maxn=(int)(1e5)+15;

//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
typedef struct cen{
	vector <set<int>> vs;
	map <int,int> M;
}cnn;
cnn C[maxn];
VI aa[maxn];
int p[maxn];
int d[maxn];
VI G[maxn];
int sz[maxn];
int dfs(int x,int pre)
{
	sz[x]=1;
	for(auto i:G[x])
	{
		if(i!=pre)
			sz[x]+=dfs(i,x);
	}
	return sz[x];
}
inline void chc(set <int> &s,int v)
{
	s.insert(v);
	if(s.size()>10)
		s.erase(s.begin());
}
void dfs1(int x,int pre,cnn &Cn)
{
	trace2(x,pre);
	set <int> v;
	if(x!=pre)
		v=Cn.vs[Cn.M[pre]];
	for(auto i:aa[x])
		chc(v,i);
	Cn.M[x]=Cn.vs.size();
	Cn.vs.pb(v);
	for(auto i:G[x])
	{
		if(i!=pre && p[i]==0)
			dfs1(i,x,Cn);
	}
}
void finc(int pc,int s,int x)
{
		for(auto i:G[x])
		{
			if(sz[i]>s/2 && p[i]==0)
			{
				sz[x]-=sz[i];
				sz[i]+=sz[x];
				finc(pc,s,i);
				return;
			}
		}
		p[x]=pc;
		d[x]=d[pc]+1;
		dfs1(x,x,C[x]);
		for(auto j:C[x].M)
		{
			trace1(j.S);
			for(auto i:C[x].vs[j.S])
				trace3(i,x,j.S);
		}
		for(auto i:G[x])
			if(p[i]==0)
				finc(x,sz[i],i);
}
set <int> aux;
int arr[25];
int main()
{
	int n,m,q,u,v,a,i,j,r;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++)
	{
		si(u);
		if(aa[u].size()<10)
			aa[u].pb(-i);
	}
	int u1,v1;
	dfs(1,0);
	for(i=1;i<=n;i++)
		printf("%d ",sz[i]);
	cout<<"\n";
	finc(maxn-1,n,1);
	for(i=1;i<=n;i++)
		printf("%d ",p[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",d[i]);
	cout<<"\n";
	while(q--)
	{
		si(u1);si(v1),si(a);
		u=u1;v=v1;
		if(d[u]<d[v])
			swap(u,v);
		while(d[u]!=d[v])
			u=p[u];
		while(u!=v)
			u=p[u],v=p[v];
		aux.clear();
		aux=C[u].vs[C[u].M[v1]];
		for(auto i:C[u].vs[C[u].M[u1]])
			chc(aux,i);
		int r=aux.size();
		for(auto i:aux)
		 arr[--r]=-i;
		int nm=min((int)aux.size(),a);
		printf("%d ",nm);
		for(i=0;i<nm;i++)
			printf("%d ",arr[i]);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn];
int P[maxn][30];
VI G[maxn];
VI C[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:C[x])
		ss[x].insert(i);
	for(auto i: ss[P[x][0]])
		ss[x].insert(i);

	while(ss[x].size()>2*a)
	{
		set <int> :: iterator it=--(ss[x].end());
		ss[x].erase(it);
	}
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
				P[i][j]=P[P[i][j-1]][j-1];
}
int lca(int p,int q)
{
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=25;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
			p=P[p][i];
	}
	if(p==q)
		return p;
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
			p=P[p][i],q=P[q][i];
	}
	return P[p][0];
}
set <int>ans;
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	//	trace1(i);
	}
	for(i=1;i<=m;i++)
		si(u),C[u].pb(i);//trace1(u);
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		int l=lca(u,v);
//trace4(l,u,v,a);
		l=P[l][0];
		ans.clear();
		for(auto i: ss[u])
			ans.insert(i);
		for(auto i: ss[v])
			ans.insert(i);
		for(auto i: ss[l])
			ans.erase(i);
		printf("%d ",min((int)ans.size(),a));
		int r=0;
		for(auto j:ans){
			printf("%d ",j);
			r++;
			if(r==a){
				break;
			}
		}
	printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn];
int P[maxn][30];
VI G[maxn];
VI C[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i: ss[P[x][0]]){
		ss[x].insert(i);
		if(ss[x].size()>2*a)
				break;
	}
	for(auto i:C[x])
		ss[x].insert(i);
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
				P[i][j]=P[P[i][j-1]][j-1];
}
int lca(int p,int q)
{
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=24;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
			p=P[p][i];
	}
	if(p==q)
		return p;
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
			p=P[p][i],q=P[q][i];
	}
	return P[p][0];
}
set <int>ans;
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	//	trace1(i);
	}
	for(i=1;i<=m;i++)
		si(u),C[u].pb(i);//trace1(u);
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		int l=lca(u,v);
//trace4(l,u,v,a);
		l=P[l][0];
		ans.clear();
		for(auto i: ss[u])
			ans.insert(i);
		for(auto i: ss[v])
			ans.insert(i);
		for(auto i: ss[l])
			ans.erase(i);
		printf("%d ",min((int)ans.size(),a));
		int r=0;
		for(auto j:ans){
			printf("%d ",j);
			r++;
			if(r==a){
				break;
			}
		}
	printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int  maxn=(int)(1e5)+15;

//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
typedef struct cen{
	vector <set<int>> vs;
	map <int,int> M;
}cnn;
cnn C[maxn];
VI aa[maxn];
int p[maxn];
int d[maxn];
VI G[maxn];
int sz[maxn];
int dfs(int x,int pre)
{
	sz[x]=1;
	for(auto i:G[x])
	{
		if(i!=pre)
			sz[x]+=dfs(i,x);
	}
	return sz[x];
}
int chc(set <int> &s,int v)
{
	s.insert(v);
	if(s.size()>10){
		int t=*(--s.end());
		s.erase(t);
		if(t==v)
			return 1;
	}
	return 0;
}
void dfs1(int x,int pre,cnn &Cn)
{
//	trace2(x,pre);
	set <int> v;
	if(x!=pre)
		v=Cn.vs[Cn.M[pre]];
	for(auto i:aa[x])
		if(chc(v,i))
			break;
	Cn.M[x]=Cn.vs.size();
	Cn.vs.pb(v);
	for(auto i:G[x])
	{
		if(i!=pre && p[i]==0)
			dfs1(i,x,Cn);
	}
}
void finc(int pc,int s,int x)
{
		for(auto i:G[x])
		{
			if(sz[i]>s/2 && p[i]==0)
			{
				sz[x]-=sz[i];
				sz[i]+=sz[x];
				finc(pc,s,i);
				return;
			}
		}
		p[x]=pc;
		d[x]=d[pc]+1;
		dfs1(x,x,C[x]);
/*		for(auto j:C[x].M)
		{
			trace1(j.S);
			for(auto i:C[x].vs[j.S])
				trace3(i,x,j.S);
		}
	*/
		for(auto i:G[x])
			if(p[i]==0)
				finc(x,sz[i],i);
}
set <int> aux;
int arr[25];
int main()
{
	int n,m,q,u,v,a,i,j,r;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++)
	{
		si(u);
		if(aa[u].size()<10)
			aa[u].pb(i);
	}
	int u1,v1;
	dfs(1,0);
	finc(maxn-1,n,1);
/*	for(i=1;i<=n;i++)
		printf("%d ",sz[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",p[i]);
	cout<<"\n";
	for(i=1;i<=n;i++)
		printf("%d ",d[i]);
	cout<<"\n";
	*/
	while(q--)
	{
		si(u1);si(v1),si(a);
		u=u1;v=v1;
		if(d[u]<d[v])
			swap(u,v);
		while(d[u]!=d[v])
			u=p[u];
		while(u!=v)
			u=p[u],v=p[v];
		aux.clear();
		aux=C[u].vs[C[u].M[v1]];
		for(auto i:C[u].vs[C[u].M[u1]])
			if(chc(aux,i))
				break;
		int nm=min((int)aux.size(),a);
		printf("%d ",nm);
		int r=0;
		for(auto i:aux){
			printf("%d ",i);r++;
			if(r==nm)
				break;
		}
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn][30];
int P[maxn][30];
VI G[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void chc(set <int> &s,int v)
{
	if(s.size()<10)
		s.insert(v);
	else if(v>*s.begin())
	{
		s.insert(v);
		s.erase(s.begin());
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
		{
			if(P[i][j-1]==0)
				continue;
			P[i][j]=P[P[i][j-1]][j-1];
			for(auto k:ss[i][j-1])
				chc(ss[i][j],k);
			for(auto k:ss[P[i][j-1]][j-1])
				chc(ss[i][j],k);
		}
}
set <int> ans;
void lca(int p,int q,int a)
{
	ans.clear();
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=21;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			p=P[p][i];
		}
	}
	if(p==q)
	{
		for(auto k:ss[p][0])
				chc(ans,k);
		return;
	}
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			for(auto k:ss[q][i])
				chc(ans,k);
			p=P[p][i];q=P[q][i];
		}
	}
	for(auto k:ss[p][1])
				chc(ans,k);
	for(auto k:ss[q][1])
				chc(ans,k);
}
int arr[15];
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++){
		si(u);
		chc(ss[u][0],-i);
	}
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		lca(u,v,a);
		printf("%d ",min((int)ans.size(),a));
		int r=ans.size();
		for(auto j:ans){
			arr[--r]=-j;
			}
		for(int j=0;j<min(a,(int)ans.size());j++)
			printf("%d ",arr[j]);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn][30];
int P[maxn][30];
VI G[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void chc(set <int> &s,int v)
{
	if(s.size()<10)
		s.insert(v);
	else if(v>*s.begin())
	{
		s.insert(v);
		s.erase(s.begin());
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
		{
			if(P[i][j-1]==0)
				continue;
			P[i][j]=P[P[i][j-1]][j-1];
			for(auto k:ss[i][j-1])
				chc(ss[i][j],k);
			for(auto k:ss[P[i][j-1]][j-1])
				chc(ss[i][j],k);
		}
}
set <int> ans;
void lca(int p,int q,int a)
{
	ans.clear();
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=21;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			p=P[p][i];
		}
	}
	if(p==q)
	{
		for(auto k:ss[p][0])
				chc(ans,k);
		return;
	}
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			for(auto k:ss[q][i])
				chc(ans,k);
			p=P[p][i];q=P[q][i];
		}
	}
	for(auto k:ss[p][1])
				chc(ans,k);
	for(auto k:ss[q][1])
				chc(ans,k);
}
int arr[15];
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++){
		si(u);
		chc(ss[u][0],-i);
	}
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		lca(u,v,a);
		printf("%d ",min((int)ans.size(),a));
		int r=ans.size();
		for(auto j:ans){
			arr[--r]=-j;
			}
		for(i=0;i<min(a,(int)ans.size());i++)
			printf("%d ",arr[i]);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn][30];
int P[maxn][30];
VI G[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<25;j++)
		for(i=1;i<=n;i++)
		{
			if(P[i][j-1]==0)
				continue;
			P[i][j]=P[P[i][j-1]][j-1];
			for(auto k:ss[i][j-1])
				ss[i][j].insert(k);
			for(auto k:ss[P[i][j-1]][j-1])
				ss[i][j].insert(k);
			while(ss[i][j].size()>a)
			{
				set <int> :: iterator it=--(ss[i][j].end());
				ss[i][j].erase(it);
			}
		}
}
set <int> ans;
void lca(int p,int q,int a)
{
	ans.clear();
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=21;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
		{
			for(auto k:ss[p][i])
				ans.insert(k);
			while(ans.size()>a)
			{
				set <int> :: iterator it=--(ans.end());
				ans.erase(it);
			}
			p=P[p][i];
		}
	}
	if(p==q)
	{
		for(auto k:ss[p][0])
			ans.insert(k);
		while(ans.size()>a)
		{
			set <int> :: iterator it=--(ans.end());
			ans.erase(it);
		}
		return;
	}
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
		{
			for(auto k:ss[p][i]){
				ans.insert(k);
				}
			for(auto k:ss[q][i]){
				ans.insert(k);
				}
			while(ans.size()>a)
			{
				set <int> :: iterator it=--(ans.end());
				ans.erase(it);
			}
			p=P[p][i];q=P[q][i];
		}
	}
	for(auto k:ss[p][1])
		ans.insert(k);
	for(auto k:ss[q][1])
		ans.insert(k);
}
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
		//	trace1(i);
	}
	for(i=1;i<=m;i++){
		si(u);
		if(ss[u][0].size()<10)
		ss[u][0].insert(i);
	}//trace1(u);
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		lca(u,v,a);
		printf("%d ",min((int)ans.size(),a));
		int r=0;
		for(auto j:ans){
			printf("%d ",j);
			r++;
			if(r==a){
				break;
			}
		}
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >  VVI;
typedef long long int   LL;
typedef unsigned long long int ULL;

#define pb push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n   //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n   //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5) //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

#define m(x) ((x)%mod);
#define mod (1e9)+7
const int maxn=(int)(1e5)+15;
const int a=10;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
set <int> ss[maxn][30];
int P[maxn][30];
VI G[maxn];
int d[maxn];
void dfs(int x)
{
	for(auto i:G[x])
	{
		if(i!=P[x][0])
			P[i][0]=x,d[i]=d[x]+1,dfs(i);
	}
}
void chc(set <int> &s,int v)
{
		s.insert(v);
		if(s.size()>10)
		s.erase(s.begin());
}
void preprocess(int n)
{
	int i,j;
	for(j=1;j<21;j++)
		for(i=1;i<=n;i++)
		{
			if(P[i][j-1]==0)
				continue;
			P[i][j]=P[P[i][j-1]][j-1];
			for(auto k:ss[i][j-1])
				chc(ss[i][j],k);
			for(auto k:ss[P[i][j-1]][j-1])
				chc(ss[i][j],k);
		}
}
set <int> ans;
void lca(int p,int q,int a)
{
	ans.clear();
	int logp,i;
	if(d[p]<d[q])
		swap(p,q);
	logp=21;
	for(i=logp;i>=0;i--)
	{
		if(((d[p]-d[q])>>i)&1)
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			p=P[p][i];
		}
	}
	if(p==q)
	{
		for(auto k:ss[p][0])
				chc(ans,k);
		return;
	}
	for(i=logp;i>=0 && P[p][0]!=P[q][0] ; i--)
	{
		if(P[p][i]!=P[q][i])
		{
			for(auto k:ss[p][i])
				chc(ans,k);
			for(auto k:ss[q][i])
				chc(ans,k);
			p=P[p][i];q=P[q][i];
		}
	}
	for(auto k:ss[p][1])
				chc(ans,k);
	for(auto k:ss[q][1])
				chc(ans,k);
}
int arr[15];
int main()
{
	int n,m,q,u,v,i,a;
	si(n);si(m);si(q);
	for(i=1;i<n;i++)
	{
		si(u);si(v);
		G[u].pb(v);
		G[v].pb(u);
	}
	for(i=1;i<=m;i++){
		si(u);
		if(ss[u][0].size()<10)
			ss[u][0].insert(-i);
	}
	dfs(1);
	preprocess(n);
	for(i=0;i<q;i++)
	{
		si(u);si(v);si(a);
		lca(u,v,a);
		printf("%d ",min((int)ans.size(),a));
		int r=ans.size();
		for(auto j:ans){
			arr[--r]=-j;
			}
		for(int j=0;j<min(a,(int)ans.size());j++)
			printf("%d ",arr[j]);
		printf("\n");
	}
	return 0;
}