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

const int N = 1e5 + 10, LOG = 20;
int par[N][LOG], h[N];
vector<int> adj[N], vec[N][LOG];

vector<int> merge(vector<int> v1, vector<int> v2) {
    vector<int> res;
    int a = 0, b = 0;
    while (a < v1.size() && b < v2.size()) {
        if (v1[a] < v2[b]) {
            res.push_back(v1[a]);
            a++;
        }
        else {
            res.push_back(v2[b]);
            b++;
        }
    }
    while (a < v1.size()) {
        res.push_back(v1[a]);
        a++;
    }
    while (b < v2.size()) {
        res.push_back(v2[b]);
        b++;
    }
    return res;
}

void dfs(int u, int parr) {
    h[u] = (parr ^ -1? h[parr] + 1: 0);
    par[u][0] = parr;
    for (int i = 1; i < LOG; i++) {
        par[u][i] = (par[u][i - 1] ^ -1? par[par[u][i - 1]][i - 1]: -1);
        if (par[u][i] ^ -1)
            vec[u][i] = merge(vec[u][i - 1], vec[par[u][i - 1]][i - 1]);
    }
    for (auto v: adj[u])
        if (v ^ parr)
            dfs(v, u);
    return;
}

int get_par(int u, int k) {
    for (int i = LOG - 1; ~i; i--)
        if (k & (1 << i))
            u = par[u][i];
    return u;
}

int lca(int u, int v) {
    if (h[u] < h[v])
        swap(u, v);
    u = get_par(u, h[u] - h[v]);
    if (u == v)
        return u;
    for (int i = LOG - 1; ~i; i--)
        if (par[u][i] != par[v][i]) {
            u = par[u][i];
            v = par[v][i];
        }
    return par[u][0];
}

vector<int> get_vec(int u, int k) {
    vector<int> res;
    for (int i = LOG - 1; ~i; i--)
        if (k & (1 << i)) {
            res = merge(res, vec[u][i]);
            u = par[u][i];
        }
    return res;
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int n, m, q, u, v, c, a;
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++) {
        cin >> u >> v;
        adj[--u].push_back(--v);
        adj[v].push_back(u);
    }
    for (int i = 0; i < m; i++) {
        cin >> c;
        if (vec[--c][0].size() < 10)
            vec[c][0].push_back(i);
    }
    dfs(0, -1);
    while (q--) {
        cin >> u >> v >> a;
        int x = lca(--u, --v);
        vector<int> ans = merge(merge(get_vec(u, h[u] - h[x]), get_vec(v, h[v] - h[x])), vec[x][0]);
        cout << min((int)ans.size(), a) << " ";
        for (int i = 0; i < min((int)ans.size(), a); i++)
            cout << ans[i] + 1 << " ";
        cout << "\n";
    }
}


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

const int N = 1e5 + 10, LOG = 20;
int par[N][LOG], h[N];
vector<int> adj[N], vec[N][LOG], res;

vector<int> merge(vector<int> v1, vector<int> v2) {
    res.clear();
    int a = 0, b = 0;
    while (a < v1.size() && b < v2.size()) {
        if (v1[a] < v2[b]) {
            res.push_back(v1[a]);
            a++;
        }
        else {
            res.push_back(v2[b]);
            b++;
        }
    }
    while (a < v1.size()) {
        res.push_back(v1[a]);
        a++;
    }
    while (b < v2.size()) {
        res.push_back(v2[b]);
        b++;
    }
    return res;
}

void dfs(int u, int parr) {
    h[u] = (parr ^ -1? h[parr] + 1: 0);
    par[u][0] = parr;
    for (int i = 1; i < LOG; i++) {
        par[u][i] = (par[u][i - 1] ^ -1? par[par[u][i - 1]][i - 1]: -1);
        if (par[u][i] ^ -1)
            vec[u][i] = merge(vec[u][i - 1], vec[par[u][i - 1]][i - 1]);
    }
    for (auto v: adj[u])
        if (v ^ parr)
            dfs(v, u);
    return;
}

int get_par(int u, int k) {
    for (int i = LOG - 1; ~i; i--)
        if (k & (1 << i))
            u = par[u][i];
    return u;
}

int lca(int u, int v) {
    if (h[u] < h[v])
        swap(u, v);
    u = get_par(u, h[u] - h[v]);
    if (u == v)
        return u;
    for (int i = LOG - 1; ~i; i--)
        if (par[u][i] != par[v][i]) {
            u = par[u][i];
            v = par[v][i];
        }
    return par[u][0];
}

vector<int> get_vec(int u, int k) {
    vector<int> res;
    for (int i = LOG - 1; ~i; i--)
        if (k & (1 << i)) {
            res = merge(res, vec[u][i]);
            u = par[u][i];
        }
    return res;
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int n, m, q, u, v, c, a;
    cin >> n >> m >> q;
    for (int i = 1; i < n; i++) {
        cin >> u >> v;
        adj[--u].push_back(--v);
        adj[v].push_back(u);
    }
    for (int i = 0; i < m; i++) {
        cin >> c;
        if (vec[--c][0].size() < 10)
            vec[c][0].push_back(i);
    }
    dfs(0, -1);
    while (q--) {
        cin >> u >> v >> a;
        int x = lca(--u, --v);
        vector<int> ans = merge(merge(get_vec(u, h[u] - h[x]), get_vec(v, h[v] - h[x])), vec[x][0]);
        cout << min((int)ans.size(), a) << " ";
        for (int i = 0; i < min((int)ans.size(), a); i++)
            cout << ans[i] + 1 << " ";
        cout << "\n";
    }
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++)
        for(int j=1;j<=n;j++)
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
            cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,0,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans;

        int h=level[u]-level[lca];

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][u]);
                u = parent[i][u];
            }
        }

        h=level[v]-level[lca];

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][v]);
                v = parent[i][v];
            }
        }

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,0,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans;

        int h=max(level[u]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][u]);
        //         u = parent[i][u];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[u] - (1 << i) >= level[lca]){
                ans=merge(ans, dp[i][u]);
                u = parent[i][u];
            }

        h=max(level[v]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][v]);
        //         v = parent[i][v];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[v] - (1 << i) >= level[lca]){
                ans=merge(ans, dp[i][v]);
                u = parent[i][v];
            }

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,0,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans1;
        vector<int>ans2;

        int h=max(level[u]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][u]);
        //         u = parent[i][u];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[u] - (1 << i) >= level[lca]){
                ans1=merge(ans1, dp[i][u]);
                u = parent[i][u];
            }

        h=max(level[v]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][v]);
        //         v = parent[i][v];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[v] - (1 << i) >= level[lca]){
                ans2=merge(ans2, dp[i][v]);
                v = parent[i][v];
            }
        vector<int>ans;
        ans=merge(ans1,ans2);

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=0;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,0,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans1;
        vector<int>ans2;

        int h=max(level[u]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][u]);
        //         u = parent[i][u];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[u] - (1 << i) >= level[lca]){
                ans1=merge(ans1, dp[i][u]);
                u = parent[i][u];
            }

        h=max(level[v]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][v]);
        //         v = parent[i][v];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[v] - (1 << i) >= level[lca]){
                ans2=merge(ans2, dp[i][v]);
                v = parent[i][v];
            }
        vector<int>ans;
        ans=merge(ans1,ans2);

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    if(b.empty())return a;
    if(a.empty())return b;

    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,-1,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans1;
        vector<int>ans2;

        int h=max(level[u]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][u]);
        //         u = parent[i][u];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[u] - (1 << i) >= level[lca]){
                ans1=merge(ans1, dp[i][u]);
                u = parent[i][u];
            }

        h=max(level[v]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][v]);
        //         v = parent[i][v];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[v] - (1 << i) >= level[lca]){
                ans2=merge(ans2, dp[i][v]);
                v = parent[i][v];
            }
        vector<int>ans;
        ans=merge(ans1,ans2);

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,0,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans;

        int h=max(level[u]-level[lca],0);

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][u]);
                u = parent[i][u];
            }
        }

        h=max(level[v]-level[lca],0);

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][v]);
                v = parent[i][v];
            }
        }

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[LG][N];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    if(b.empty())return a;
    if(a.empty())return b;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,-1,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans1;
        vector<int>ans2;

        int h=max(level[u]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][u]);
        //         u = parent[i][u];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[u] - (1 << i) >= level[lca]){
                ans1=merge(ans1, dp[i][u]);
                u = parent[i][u];
            }

        h=max(level[v]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][v]);
        //         v = parent[i][v];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[v] - (1 << i) >= level[lca]){
                ans2=merge(ans2, dp[i][v]);
                v = parent[i][v];
            }

        vector<int>ans;
        ans=merge(ans1,ans2);

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++)
        for(int j=1;j<=n;j++)
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        if(sz(cnt[x])<10)
            cnt[x].pb(i+1);
    }

    dfs(1,0,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans;

        int h=level[u]-level[lca];

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][u]);
                u = parent[i][u];
            }
        }

        h=level[v]-level[lca];

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][v]);
                v = parent[i][v];
            }
        }

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[N][LG];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        //if(sz(cnt[x])<10)
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,-1,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);

        vector<int>ans1;
        vector<int>ans2;

        int h=max(level[u]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][u]);
        //         u = parent[i][u];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[u] - (1 << i) >= level[lca]){
                ans1=merge(ans1, dp[i][u]);
                u = parent[i][u];
            }

        h=max(level[v]-level[lca],0);

        // for(int i=LG-1;i>=0;i--)
        // {
        //     if((h>>i) & 1){
        //         ans=merge(ans,dp[i][v]);
        //         v = parent[i][v];
        //     }
        // }
        for (int i = LG; i >= 0; i--)
            if (level[v] - (1 << i) >= level[lca]){
                ans2=merge(ans2, dp[i][v]);
                v = parent[i][v];
            }
        vector<int>ans;
        ans=merge(ans1,ans2);

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
 * Author    : raj1307 - Raj Singh
 * Date      : 23.08.2020
 */

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fr(i, a, b) for(int i = (a); i < (b); ++i)
#define fb(i, b, a) for(int i = (b); i > (a); --i)
#define fill(x,y) memset(x,y,sizeof(x))
#define rr return
#define mp make_pair
#define pb push_back
#define sz(x) ((int)x.size())
#define int long long
#define ll long long
#define ld long double
#define S second
#define F first
#define endl "\n"
#define Endl "\n"
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a>b) return b; else return a;}
int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b);}
inline int lcm(int a,int b){ return a / gcd(a, b) * b;}
inline int normalize(int x,int mod){ x %= mod; if (x < 0) x += mod; return x;}

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
string abc="abcdefghijklmnopqrstuvwxyz";
const double PI=acosl(-1);
const int mod = 1000*1000*1000+7;
//const int mod = 998244353;
const int inf = 1e18+5;

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; } // expexts c doesn't exceeds 2p
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; } // ...
inline int mul(int a, int b, int p = mod){ return (a * 1LL * b) % p; }  // ...

// template<typename T>
// using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

const int N = 1e5 + 5;

int n,q,m;

vector<int>g[N];
int ans[N];

const int LG = 20;

vector<int>dp[LG][N];
vector<int>cnt[N];

int tim=0;
int parent[LG][N];
int tin[N], tout[N], level[N];

void dfs(int k, int par, int lvl)
{
    tin[k]=++tim;
    parent[0][k]=par;
    dp[0][k]=cnt[k];
    level[k]=lvl;
    for(auto it:g[k])
    {
        if(it==par)
            continue;
        dfs(it, k, lvl+1);
    }
    tout[k]=tim;
}
vector<int> merge(vector<int>&a, vector<int>&b){
    vector<int>res;
    if(b.empty())return a;
    if(a.empty())return b;
    for(int i:a) res.pb(i);
    for(int i:b) res.pb(i);
    sort(all(res));
    if(sz(res)>10)
        res.resize(10);
    return res;
}

int walk(int u, int h)
{
    for(int i=LG-1;i>=0;i--)
    {
        if((h>>i) & 1)
            u = parent[i][u];
    }
    return u;
}

void precompute()
{
    for(int i=1;i<LG;i++){
        for(int j=1;j<=n;j++){
            if(parent[i-1][j]){
                parent[i][j]=parent[i-1][parent[i-1][j]];
                dp[i][j]=merge(dp[i-1][j],dp[i-1][parent[i-1][j]]);
            }
        }
    }
}

int LCA(int u, int v)
{
    if(level[u]<level[v])
        swap(u,v);
    int diff=level[u]-level[v];
    for(int i=LG-1;i>=0;i--)
    {
        if((1<<i) & diff)
        {
            u=parent[i][u];
        }
    }
    if(u==v)
        return u;
    for(int i=LG-1;i>=0;i--)
    {
        if(parent[i][u] && parent[i][u]!=parent[i][v])
        {
            u=parent[i][u];
            v=parent[i][v];
        }
    }
    return parent[0][u];
}

void solve(){

    cin>>n>>m>>q;
    fr(i,1,n){
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
        g[v].pb(u);

    }
    fr(i,0,m){
        int x;
        cin>>x;
        cnt[x].pb(i+1);
    }
    for(int i=1; i<=n; i++)
        while(cnt[i].size()>10) cnt[i].pop_back();

    dfs(1,-1,0);
    precompute();

    while(q--){
        int u,v,a;
        cin>>u>>v>>a;

        int lca=LCA(u,v);
        vector<int>ans;

        int h=max(level[u]-level[lca],0);

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][u]);
                u = parent[i][u];
            }
        }

        h=max(level[v]-level[lca],0);

        for(int i=LG-1;i>=0;i--)
        {
            if((h>>i) & 1){
                ans=merge(ans,dp[i][v]);
                v = parent[i][v];
            }
        }

        ans=merge(ans,cnt[lca]);

        while(sz(ans)>a) ans.pop_back();

        cout<<sz(ans)<<" ";
        for(int i:ans) cout<<i<<" ";
        cout<<endl;

    }

}

signed main() {
    fio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        //freopen("error.txt", "w", stderr);
    #endif
    cout<<fixed<<setprecision(10);
    int t=1;
    //cin>>t;  // UNCOMMENT FOR TEST-CASES
    //precompute();
    int cnt=1;
    while(t--) {
        //cout<<"Case #"<<cnt++<<": ";
        solve();
    }
    return 0;
}


/*
    ____        __
   / __ \____  / /_  ____ _____ ___
  / /_/ / __ \/ __ \/ __ `/ __ `__ \
 / _, _/ /_/ / / / / /_/ / / / / / /
/_/ |_|\____/_/ /_/\__,_/_/ /_/ /_/
*/
#include<bits/stdc++.h>

typedef long long ll ;

#define pll pair<ll , ll >
#define X   first
#define Y   second
#define mp  make_pair
#define pii pair<int , int>
#define vec vector
#define vpii vector<pair<int , int>>
#define i_n   int i = 0 ; i< n ; i++
#define cn  int n ; cin>>n
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define cina int a[n] ; for(int i = 0 ; i < n ; i++) cin>>a[i]
#define pb push_back

using namespace std;
const int maxn = 1000*100+5 ;
const ll inf = 9223372036854775807 ;

int n , m , q , par[maxn][50]  , mark[maxn] , h[maxn] , b = 0 ;
vec<int> p[maxn] ,  dp[maxn][50] , pd[maxn][50] , ans ;
vec<int> adj[maxn] ;

void dfs(int v)
{
	//cout<<v<< ' ' ;
	mark[v] = 1 ;
	for(auto u : adj[v])
	{
		if(mark[u] == 0)
		{
			par[u][0] = v ;
			 for(int i = 1  ; i < 31 ; i ++ )
			 {
			 	par[u][i] = par[par[u][i-1]][i-1] ;
			 }

			 pd[u][0] = p[u] ;

			 for(int i = 1 ; i < 31 ; i ++ )
			 {
			 	pd[u][i] = pd[u][i-1] ;
			 	for(int j = 0 ; j < pd[par[u][i-1]][i-1].size() ; j++ )
			 	{
			 		pd[u][i].pb( pd[par[u][i-1]][i-1][j] ) ;
				}
				sort(pd[u][i].begin() , pd[u][i].end())  ;
				if(pd[u][i].size() > 10)
				{
					pd[u][i].resize(10) ;
				}

			 	dp[u][0] = pd[u][1]  ;

				 dp[u][i] = pd[u][i-1] ;
				 for(int j = 0 ; j < dp[par[u][i-1]][i-1].size() ; j++ )
				 {
				 	dp[u][i].pb( dp[par[u][i-1]][i-1][j] ) ;
				 }

				 sort(dp[u][i].begin() , dp[u][i].end())  ;
				 if(dp[u][i].size() > 10)
				 {
				 	dp[u][i].resize(10) ;
				 }

			 }

			 h[u] = h[v] + 1;
			 dfs(u) ;
		}
	}
}

void merge(int v , int i)
{
	for(int j = 0 ; j < pd[v][i].size() ; j ++ )
	{
		ans.pb(pd[v][i][j]) ;
	}
	sort(ans.begin() , ans.end()) ;
	if(ans.size() > 10) ans.resize(10) ;
}

int lca(int u , int v)
{
	if(h[u] > h[v])
	{
		swap(u , v) ;
	}
	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != 0  && h[par[v][i]] >= h[u])
		{
			merge(v , i) ;
			v = par[v][i] ;
			b = 1 ;
		}
	}

	if(v == u) return u ;

	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != par[u][i])
		{
			merge(v , i) ;
			merge(u , i) ;
			v = par[v][i] ;
			u = par[u][i] ;
		}
	}

	merge(par[u][0] , 0) ;
	return (par[u][0]) ;
}

int main()
{
	migmig ;
	cin>>n>>m>> q ;
	for(int i = 0 ; i < n - 1 ; i ++ )
	{
		int u , v ;
		cin>>u>>v ;
		adj[u].pb(v) ;
		adj[v].pb(u) ;
		}
	for(int i = 1 ;i <= m ; i ++ )
	{
		int x ;
		cin>>x ;
		p[x].pb(i) ;
	}
	for(int i = 1 ; i <= n ; i ++  )
	{
		sort(p[i].begin() , p[i].end()) ;
		if(p[i].size() > 10)
		{
			p[i].resize(10) ;
		}
	}
	pd[1][0] = p[1] ;
	dfs(1) ;

	/*
	for(int i = 1 ; i <= n ; i ++ )
	{
		for(int j = 0 ; j <= 1 ; j ++ )
		{
			cout<<i << " " << j << " DP : " << endl ;
			for(int k = 0 ; k < dp[i][j].size() ; k ++ )
			{
				cout<<dp[i][j][k] << " "  ;
			}
			cout<<endl  ;
		}
	}
	*/

	for(int j = 1 ; j <= q ; j ++ )
	{
		int u, v , a  ;
		cin>>u>>v>>a ;
		ans.clear() ; b = 0 ;

		int l = lca(u, v)  ;
		if(b == 0)
		{
			if(h[l] - h[u] <= 1 )
			{
			merge(u , 0) ;
			}
			if(h[l] - h[v] <= 1 && v != u )
			{
			merge(v ,0 ) ;
			}
		}
		else
		{
			merge(l  ,  0) ;
		}
	//	cout<<"  lca   "<<l << " : " ;
		cout<<min(a , (int)ans.size())<<" " ;
		for(int i = 0 ; i < min(a , (int)ans.size()) ; i ++ )
		{
			cout<<ans[i] << " " ;
		}
		cout<<endl ;
	}
}
//////
////////
///////////


/*
    ____        __
   / __ \____  / /_  ____ _____ ___
  / /_/ / __ \/ __ \/ __ `/ __ `__ \
 / _, _/ /_/ / / / / /_/ / / / / / /
/_/ |_|\____/_/ /_/\__,_/_/ /_/ /_/
*/
#include<bits/stdc++.h>

typedef long long ll ;

#define pll pair<ll , ll >
#define X   first
#define Y   second
#define mp  make_pair
#define pii pair<int , int>
#define vec vector
#define vpii vector<pair<int , int>>
#define i_n   int i = 0 ; i< n ; i++
#define cn  int n ; cin>>n
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define cina int a[n] ; for(int i = 0 ; i < n ; i++) cin>>a[i]
#define pb push_back

using namespace std;
const int maxn = 1000*100+5 ;
const ll inf = 9223372036854775807 ;

int n , m , q , par[maxn][50]  , mark[maxn] , h[maxn];
vec<int> p[maxn] ,  dp[maxn][50] , pd[maxn][50] , ans ;
vec<int> adj[maxn] ;

void dfs(int v)
{
	//cout<<v<< ' ' ;
	mark[v] = 1 ;
	for(auto u : adj[v])
	{
		if(mark[u] == 0)
		{
			par[u][0] = v ;
			 for(int i = 1  ; i < 31 ; i ++ )
			 {
			 	par[u][i] = par[par[u][i-1]][i-1] ;
			 }

			 pd[u][0] = p[u] ;

			 for(int i = 1 ; i < 31 ; i ++ )
			 {
			 	pd[u][i] = pd[u][i-1] ;
			 	for(int j = 0 ; j < pd[par[u][i-1]][i-1].size() ; j++ )
			 	{
			 		pd[u][i].pb( pd[par[u][i-1]][i-1][j] ) ;
				}
				sort(pd[u][i].begin() , pd[u][i].end())  ;
				if(pd[u][i].size() > 10)
				{
					pd[u][i].resize(10) ;
				}

			 	dp[u][0] = pd[u][1]  ;

				 dp[u][i] = pd[u][i-1] ;
				 for(int j = 0 ; j < dp[par[u][i-1]][i-1].size() ; j++ )
				 {
				 	dp[u][i].pb( dp[par[u][i-1]][i-1][j] ) ;
				 }

				 sort(dp[u][i].begin() , dp[u][i].end())  ;
				 if(dp[u][i].size() > 10)
				 {
				 	dp[u][i].resize(10) ;
				 }

			 }

			 h[u] = h[v] + 1;
			 dfs(u) ;
		}
	}
}

void merge(int v , int i)
{
	for(int j = 0 ; j < pd[v][i].size() ; j ++ )
	{
		ans.pb(pd[v][i][j]) ;
	}
	sort(ans.begin() , ans.end()) ;
	if(ans.size() > 10) ans.resize(10) ;
}

int lca(int u , int v)
{
	if(h[u] > h[v])
	{
		swap(u , v) ;
	}
	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != 0  && h[par[v][i]] >= h[u])
		{
			merge(v , i) ;
			v = par[v][i] ;
		}
	}

	if(v == u) return u ;

	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != par[u][i])
		{
			merge(v , i) ;
			merge(u , i) ;
			v = par[v][i] ;
			u = par[u][i] ;
		}
	}

	merge(par[u][0] , 0) ;
	return (par[u][0]) ;
}

int main()
{
	migmig ;
	cin>>n>>m>> q ;
	for(int i = 0 ; i < n - 1 ; i ++ )
	{
		int u , v ;
		cin>>u>>v ;
		adj[u].pb(v) ;
		adj[v].pb(u) ;
		}
	for(int i = 1 ;i <= m ; i ++ )
	{
		int x ;
		cin>>x ;
		p[x].pb(i) ;
	}
	for(int i = 1 ; i <= n ; i ++  )
	{
		sort(p[i].begin() , p[i].end()) ;
		if(p[i].size() > 10)
		{
			p[i].resize(10) ;
		}
	}
	pd[1][0] = p[1] ;
	dfs(1) ;

	/*
	for(int i = 1 ; i <= n ; i ++ )
	{
		for(int j = 0 ; j <= 1 ; j ++ )
		{
			cout<<i << " " << j << " DP : " << endl ;
			for(int k = 0 ; k < dp[i][j].size() ; k ++ )
			{
				cout<<dp[i][j][k] << " "  ;
			}
			cout<<endl  ;
		}
	}
	*/

	for(int j = 1 ; j <= q ; j ++ )
	{
		int u, v , a  ;
		cin>>u>>v>>a ;
		ans.clear() ;

		int l = lca(u, v)  ;
		if(h[l] - h[u] <= 1)
		{
			merge(u , 0) ;
		}
		if(h[l] - h[v] <= 1 && v != u)
		{
			merge(v ,0 ) ;
		}
		//cout<<"  boom  " ;
		cout<<min(a , (int)ans.size())<<" " ;
		for(int i = 0 ; i < min(a , (int)ans.size()) ; i ++ )
		{
			cout<<ans[i] << " " ;
		}
		cout<<endl ;
	}
}
//////
////////
///////////


/*
    ____        __
   / __ \____  / /_  ____ _____ ___
  / /_/ / __ \/ __ \/ __ `/ __ `__ \
 / _, _/ /_/ / / / / /_/ / / / / / /
/_/ |_|\____/_/ /_/\__,_/_/ /_/ /_/
*/
#include<bits/stdc++.h>

typedef long long ll ;

#define pll pair<ll , ll >
#define X   first
#define Y   second
#define mp  make_pair
#define pii pair<int , int>
#define vec vector
#define vpii vector<pair<int , int>>
#define i_n   int i = 0 ; i< n ; i++
#define cn  int n ; cin>>n
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define cina int a[n] ; for(int i = 0 ; i < n ; i++) cin>>a[i]
#define pb push_back

using namespace std;
const int maxn = 1000*100+5 ;
const ll inf = 9223372036854775807 ;

int n , m , q , par[maxn][50]  , mark[maxn] , h[maxn] , b = 0 ;
vec<int> p[maxn] ,  dp[maxn][50] , pd[maxn][50] , ans ;
vec<int> adj[maxn] ;

void dfs(int v)
{
	//cout<<v<< ' ' ;
	mark[v] = 1 ;
	for(auto u : adj[v])
	{
		if(mark[u] == 0)
		{
			par[u][0] = v ;
			 for(int i = 1  ; i < 31 ; i ++ )
			 {
			 	par[u][i] = par[par[u][i-1]][i-1] ;
			 }

			 pd[u][0] = p[u] ;

			 for(int i = 1 ; i < 31 ; i ++ )
			 {
			 	pd[u][i] = pd[u][i-1] ;
			 	for(int j = 0 ; j < pd[par[u][i-1]][i-1].size() ; j++ )
			 	{
			 		pd[u][i].pb( pd[par[u][i-1]][i-1][j] ) ;
				}
				sort(pd[u][i].begin() , pd[u][i].end())  ;
				if(pd[u][i].size() > 10)
				{
					pd[u][i].resize(10) ;
				}

			 	dp[u][0] = pd[u][1]  ;

				 dp[u][i] = pd[u][i-1] ;
				 for(int j = 0 ; j < dp[par[u][i-1]][i-1].size() ; j++ )
				 {
				 	dp[u][i].pb( dp[par[u][i-1]][i-1][j] ) ;
				 }

				 sort(dp[u][i].begin() , dp[u][i].end())  ;
				 if(dp[u][i].size() > 10)
				 {
				 	dp[u][i].resize(10) ;
				 }

			 }

			 h[u] = h[v] + 1;
			 dfs(u) ;
		}
	}
}

void merge(int v , int i)
{
	for(int j = 0 ; j < pd[v][i].size() ; j ++ )
	{
		ans.pb(pd[v][i][j]) ;
	}
	sort(ans.begin() , ans.end()) ;
	if(ans.size() > 10) ans.resize(10) ;
}

int lca(int u , int v)
{
	if(h[u] > h[v])
	{
		swap(u , v) ;
	}
	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != 0  && h[par[v][i]] >= h[u])
		{
			merge(v , i) ;
			v = par[v][i] ;
			b = 1 ;
		}
	}

	if(v == u)
	{
		merge(u , 0) ;
		return u ;

	 }

	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != par[u][i])
		{
			merge(v , i) ;
			merge(u , i) ;
			v = par[v][i] ;
			u = par[u][i] ;
		}
	}

	merge(par[u][0] , 0) ;
	merge(u , 0) ;
	merge(v ,0) ;
	return (par[u][0]) ;
}

int main()
{
	migmig ;
	cin>>n>>m>> q ;
	for(int i = 0 ; i < n - 1 ; i ++ )
	{
		int u , v ;
		cin>>u>>v ;
		adj[u].pb(v) ;
		adj[v].pb(u) ;
		}
	for(int i = 1 ;i <= m ; i ++ )
	{
		int x ;
		cin>>x ;
		p[x].pb(i) ;
	}
	for(int i = 1 ; i <= n ; i ++  )
	{
		sort(p[i].begin() , p[i].end()) ;
		if(p[i].size() > 10)
		{
			p[i].resize(10) ;
		}
	}
	pd[1][0] = p[1] ;
	dfs(1) ;

	/*
	for(int i = 1 ; i <= n ; i ++ )
	{
		for(int j = 0 ; j <= 1 ; j ++ )
		{
			cout<<i << " " << j << " DP : " << endl ;
			for(int k = 0 ; k < dp[i][j].size() ; k ++ )
			{
				cout<<dp[i][j][k] << " "  ;
			}
			cout<<endl  ;
		}
	}
	*/

	for(int j = 1 ; j <= q ; j ++ )
	{
		int u, v , a  ;
		cin>>u>>v>>a ;
		ans.clear() ; b = 0 ;

		int l = lca(u, v)  ;
		//cout<<"  lca   "<<l << " : " ;
		cout<<min(a , (int)ans.size())<<" " ;
		for(int i = 0 ; i < min(a , (int)ans.size()) ; i ++ )
		{
			cout<<ans[i] << " " ;
		}
		cout<<endl ;
	}
}
//////
////////
///////////


/*
    ____        __
   / __ \____  / /_  ____ _____ ___
  / /_/ / __ \/ __ \/ __ `/ __ `__ \
 / _, _/ /_/ / / / / /_/ / / / / / /
/_/ |_|\____/_/ /_/\__,_/_/ /_/ /_/
*/
#include<bits/stdc++.h>

typedef long long ll ;

#define pll pair<ll , ll >
#define X   first
#define Y   second
#define mp  make_pair
#define pii pair<int , int>
#define vec vector
#define vpii vector<pair<int , int>>
#define i_n   int i = 0 ; i< n ; i++
#define cn  int n ; cin>>n
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define cina int a[n] ; for(int i = 0 ; i < n ; i++) cin>>a[i]
#define pb push_back

using namespace std;
const int maxn = 1000*100+5 ;
const ll inf = 9223372036854775807 ;

int n , m , q , par[maxn][50]  , mark[maxn] , h[maxn];
vec<int> p[maxn] ,  dp[maxn][50] , pd[maxn][50] , ans ;
vec<int> adj[maxn] ;

void dfs(int v)
{
	//cout<<v<< ' ' ;
	mark[v] = 1 ;
	for(auto u : adj[v])
	{
		if(mark[u] == 0)
		{
			par[u][0] = v ;
			 for(int i = 1  ; i < 31 ; i ++ )
			 {
			 	par[u][i] = par[par[u][i-1]][i-1] ;
			 }

			 pd[u][0] = p[u] ;

			 for(int i = 1 ; i < 31 ; i ++ )
			 {
			 	pd[u][i] = pd[u][i-1] ;
			 	for(int j = 0 ; j < pd[par[u][i-1]][i-1].size() ; j++ )
			 	{
			 		pd[u][i].pb( pd[par[u][i-1]][i-1][j] ) ;
				}
				sort(pd[u][i].begin() , pd[u][i].end())  ;
				if(pd[u][i].size() > 10)
				{
					pd[u][i].resize(10) ;
				}

			 	dp[u][0] = pd[u][1]  ;

				 dp[u][i] = pd[u][i-1] ;
				 for(int j = 0 ; j < dp[par[u][i-1]][i-1].size() ; j++ )
				 {
				 	dp[u][i].pb( dp[par[u][i-1]][i-1][j] ) ;
				 }

				 sort(dp[u][i].begin() , dp[u][i].end())  ;
				 if(dp[u][i].size() > 10)
				 {
				 	dp[u][i].resize(10) ;
				 }

			 }

			 h[u] = h[v] + 1;
			 dfs(u) ;
		}
	}
}

void merge(int v , int i)
{
	for(int j = 0 ; j < pd[v][i].size() ; j ++ )
	{
		ans.pb(pd[v][i][j]) ;
	}
	sort(ans.begin() , ans.end()) ;
	if(ans.size() > 10) ans.resize(10) ;
}

int lca(int u , int v)
{
	if(h[u] > h[v])
	{
		swap(u , v) ;
	}
	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != 0  && h[par[v][i]] >= h[u])
		{
			merge(v , i) ;
			v = par[v][i] ;
		}
	}

	if(v == u) return u ;

	for(int i = 30 ; i >= 0 ; i -- )
	{
		if(par[v][i] != par[u][i])
		{
			merge(v , i) ;
			merge(u , i) ;
			v = par[v][i] ;
			u = par[u][i] ;
		}
	}

	merge(par[u][0] , 0) ;
	return (par[u][0]) ;
}

int main()
{
	migmig ;
	cin>>n>>m>> q ;
	for(int i = 0 ; i < n - 1 ; i ++ )
	{
		int u , v ;
		cin>>u>>v ;
		adj[u].pb(v) ;
		adj[v].pb(u) ;
		}
	for(int i = 1 ;i <= m ; i ++ )
	{
		int x ;
		cin>>x ;
		p[x].pb(i) ;
	}
	for(int i = 1 ; i <= n ; i ++  )
	{
		sort(p[i].begin() , p[i].end()) ;
		if(p[i].size() > 10)
		{
			p[i].resize(10) ;
		}
	}
	pd[1][0] = p[1] ;
	dfs(1) ;

	/*
	for(int i = 1 ; i <= n ; i ++ )
	{
		for(int j = 0 ; j <= 1 ; j ++ )
		{
			cout<<i << " " << j << " DP : " << endl ;
			for(int k = 0 ; k < dp[i][j].size() ; k ++ )
			{
				cout<<dp[i][j][k] << " "  ;
			}
			cout<<endl  ;
		}
	}
	*/

	for(int j = 1 ; j <= q ; j ++ )
	{
		int u, v , a  ;
		cin>>u>>v>>a ;
		ans.clear() ;

		int l = lca(u, v)  ;
		if(h[l] - h[u] <= 1)
		{
			merge(u , 0) ;
		}
		if(h[l] - h[v] <= 1)
		{
			merge(v ,0 ) ;
		}
		//cout<<"  boom  " ;
		cout<<min(a , (int)ans.size())<<" " ;
		for(int i = 0 ; i < min(a , (int)ans.size()) ; i ++ )
		{
			cout<<ans[i] << " " ;
		}
		cout<<endl ;
	}
}
//////
////////
///////////


#include <bits/stdc++.h>

using namespace std;

#define MAXN 100005
#define HST 131072
#define SST 262144
#define LG 19

int n, m, q;
int bc[MAXN];
int sz[MAXN];
int hei[MAXN];
int pos[MAXN];
int head[MAXN];
int par[MAXN][LG];
int lst=HST;

const int est = SST - 1;

vector<int> st[SST];
vector<int> adj[MAXN];

void merge(const vector<int> &a, const vector<int> &b, vector<int> &c){
	c.clear();
	auto p1 = a.begin();
	auto p2 = b.begin();
	int cnt = 0;
	while(cnt < 10 && (p1 != a.end() || p2 != b.end())){
		cnt++;
		if(p1 == a.end()){
			c.push_back(*p2);
			p2++;
		} else if(p2 == b.end()){
			c.push_back(*p1);
			p1++;
		} else {
			if(*p1 <= *p2){
				c.push_back(*p1);
				p1++;
			} else {
				c.push_back(*p2);
				p2++;
			}
		}
	}
}

int dfs(int st, int pr, int h){
	par[st][0] = pr;
	for(int i = 1; i < LG; i++){
		par[st][i] = par[par[st][i-1]][i-1];
	}
	hei[st] = h;
	for(auto x:adj[st]){
		if(x == pr)
			continue;
		sz[st] += dfs(x, st, h+1);
		if(sz[x] > sz[bc[st]])
			bc[st] = x;
	}
	sz[st] += 1;
	return sz[st];
}

void decompose(int curr, int hd){
	head[curr] = hd;
	pos[curr] = lst++;
	if(bc[curr]){
		decompose(bc[curr], hd);
	}
	for(auto x:adj[curr]){
		if(x == par[curr][0] || x == bc[curr])
			continue;
		decompose(x, x);
	}
}

int lca(int a, int b){
	int diff = hei[b] - hei[a];
	for(int i = LG-1; i >= 0; i--){
		if(diff & (1 << i))
			b = par[b][i];
	}
	if(a == b)
		return -1;
	int ans = a;
	for(int i = LG-1; i; i--){
		if(par[a][i] != par[b][i])
			ans = par[ans][i];
	}
	return ans;
}

void query(int l, int r){ //stores ans in st[0]. uses st[est] too!
	st[0].clear();
	while(l <= r){
		if(l & 1){
			merge(st[0], st[l], st[est]);
			st[0].swap(st[est]);
			l++;
		}
		if(r+1&1){
			merge(st[0], st[r], st[est]);
			st[0].swap(st[est]);
			r--;
		}
		l >>= 1; r >>= 1;
	}
}

void ask(int bg, int ed){ //stores ans in st[est-1]. uses st[est] and st[0] too!
	st[est-1].clear();
	while(hei[head[bg]] > hei[ed]){
		query(pos[head[bg]], pos[bg]);
		merge(st[0], st[est-1], st[est]);
		st[est-1].swap(st[est]);
		bg = par[head[bg]][0];
	}
	query(pos[head[bg]] + (hei[ed] - hei[head[bg]]), pos[bg]);
	merge(st[0], st[est-1], st[est]);
	st[est-1].swap(st[est]);
}

int main(){
	for(int i = 0; i < SST; i++)
		st[i].reserve(11);
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(1, 0, 1);
	decompose(1, 1);
	for(int i = 1; i <= m; i++){
		int a;
		scanf("%d", &a);
		if(st[pos[a]].size() < 10)
			st[pos[a]].push_back(i);
	}
	for(int i = HST-1; i; i--){
		int lch = i << 1;
		int rch = lch +1;
		merge(st[lch], st[rch], st[i]);
	}
	for(int _ = 0; _ < q; _++){
		int a, u, v;
		scanf("%d%d%d", &v, &u, &a);
		if(hei[u] > hei[v])
			swap(u, v);
		int pr = lca(u, v);
		if(pr == -1){
			ask(v, u);
			int tsz = min(a, int(st[est-1].size()));
			printf("%d ", tsz);
			for(int i = 0; i < tsz; i++)
				printf("%d ", st[est-1][i]);
		} else {
			ask(u, pr);
			st[est-2].swap(st[est-1]);
			ask(v, par[pr][0]);
			merge(st[est-2], st[est-1], st[est]);
			int tsz = min(a, int(st[est].size()));
			printf("%d ", tsz);
			for(int i = 0; i < tsz; i++)
				printf("%d ", st[est][i]);
		}
		puts("");
	}
}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 100005
#define HST 131072
#define SST 262144
#define LG 19

int n, m, q;
int bc[MAXN];
int sz[MAXN];
int hei[MAXN];
int pos[MAXN];
int head[MAXN];
int par[MAXN][LG];
int lst=HST;

const int est = SST - 1;

vector<int> st[SST];
vector<int> adj[MAXN];

void merge(const vector<int> &a, const vector<int> &b, vector<int> &c){
	c.clear();
	auto p1 = a.begin();
	auto p2 = b.begin();
	int cnt = 0;
	while(cnt < 10 && (p1 != a.end() || p2 != b.end())){
		cnt++;
		if(p1 == a.end()){
			c.push_back(*p2);
			p2++;
		} else if(p2 == b.end()){
			c.push_back(*p1);
			p1++;
		} else {
			if(*p1 <= *p2){
				c.push_back(*p1);
				p1++;
			} else {
				c.push_back(*p2);
				p2++;
			}
		}
	}
}

int dfs(int st, int pr, int h){
	par[st][0] = pr;
	for(int i = 1; i < LG; i++){
		par[st][i] = par[par[st][i-1]][i-1];
	}
	hei[st] = h;
	for(auto x:adj[st]){
		if(x == pr)
			continue;
		sz[st] += dfs(x, st, h+1);
		if(sz[x] > sz[bc[st]])
			bc[st] = x;
	}
	sz[st]++;
	return sz[st];
}

void decompose(int curr, int hd){
	head[curr] = hd;
	pos[curr] = lst++;
	if(bc[curr]){
		decompose(bc[curr], hd);
	}
	for(auto x:adj[curr]){
		if(x == par[curr][0] || x == bc[curr])
			continue;
		decompose(x, x);
	}
}

int lca(int a, int b){
	int diff = hei[b] - hei[a];
	for(int i = LG-1; i >= 0; i--){
		if(diff & (1 << i))
			b = par[b][i];
	}
	if(a == b)
		return -1;
	for(int i = LG-1; i >= 0; i--){
		if(par[a][i] != par[b][i]){
			a = par[a][i];
			b = par[b][i];
		}
	}
	return a;
}

void query(int l, int r){ //stores ans in st[0]. uses st[est] too!
	st[0].clear();
	while(l <= r){
		if(l & 1){
			merge(st[0], st[l], st[est]);
			st[0].swap(st[est]);
			l++;
		}
		if(r+1&1){
			merge(st[0], st[r], st[est]);
			st[0].swap(st[est]);
			r--;
		}
		l >>= 1; r >>= 1;
	}
}

void ask(int bg, int ed){ //stores ans in st[est-1]. uses st[est] and st[0] too!
	st[est-1].clear();
	while(hei[head[bg]] > hei[ed]){
		query(pos[head[bg]], pos[bg]);
		merge(st[0], st[est-1], st[est]);
		st[est-1].swap(st[est]);
		bg = par[head[bg]][0];
	}
	query(pos[head[bg]] + (hei[ed] - hei[head[bg]]), pos[bg]);
	merge(st[0], st[est-1], st[est]);
	st[est-1].swap(st[est]);
}

int main(){
	for(int i = 0; i < SST; i++)
		st[i].reserve(11);
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(1, 0, 1);
	decompose(1, 1);
	for(int i = 1; i <= m; i++){
		int a;
		scanf("%d", &a);
		if(st[pos[a]].size() < 10)
			st[pos[a]].push_back(i);
	}
	for(int i = HST-1; i; i--){
		int lch = i << 1;
		int rch = lch +1;
		merge(st[lch], st[rch], st[i]);
	}
	for(int _ = 0; _ < q; _++){
		int a, u, v;
		scanf("%d%d%d", &v, &u, &a);
		if(hei[u] > hei[v])
			swap(u, v);
		int pr = lca(u, v);
		if(pr == -1){
			ask(v, u);
			int tsz = min(a, int(st[est-1].size()));
			printf("%d ", tsz);
			for(int i = 0; i < tsz; i++)
				printf("%d ", st[est-1][i]);
		} else {
			ask(u, pr);
			st[est-2].swap(st[est-1]);
			ask(v, par[pr][0]);
			merge(st[est-2], st[est-1], st[est]);
			int tsz = min(a, int(st[est].size()));
			printf("%d ", tsz);
			for(int i = 0; i < tsz; i++)
				printf("%d ", st[est][i]);
		}
		puts("");
	}
}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 100005
#define HST 131072
#define SST 262144
#define LG 19

int n, m, q;
int bc[MAXN];
int sz[MAXN];
int hei[MAXN];
int pos[MAXN];
int head[MAXN];
int par[MAXN][LG];
int lst=HST;

const int est = SST - 1;

vector<int> st[SST];
vector<int> adj[MAXN];

void merge(const vector<int> &a, const vector<int> &b, vector<int> &c){
	c.clear();
	auto p1 = a.begin();
	auto p2 = b.begin();
	int cnt = 0;
	while(cnt < 10 && (p1 != a.end() || p2 != b.end())){
		cnt++;
		if(p1 == a.end()){
			c.push_back(*p2);
			p2++;
		} else if(p2 == b.end()){
			c.push_back(*p1);
			p1++;
		} else {
			if(*p1 <= *p2){
				c.push_back(*p1);
				p1++;
			} else {
				c.push_back(*p2);
				p2++;
			}
		}
	}
}

int dfs(int st, int pr, int h){
	par[st][0] = pr;
	for(int i = 1; i < LG; i++){
		par[st][i] = par[par[st][i-1]][i-1];
	}
	hei[st] = h;
	for(auto x:adj[st]){
		if(x == pr)
			continue;
		sz[st] += dfs(x, st, h+1);
		if(sz[x] > sz[bc[st]])
			bc[st] = x;
	}
	sz[st]++;
	return sz[st];
}

void decompose(int curr, int hd){
	head[curr] = hd;
	pos[curr] = lst++;
	if(bc[curr]){
		decompose(bc[curr], hd);
	}
	for(auto x:adj[curr]){
		if(x == par[curr][0] || x == bc[curr])
			continue;
		decompose(x, x);
	}
}

int lca(int a, int b){
	int diff = hei[b] - hei[a];
	for(int i = LG-1; i >= 0; i--){
		if(diff & (1 << i))
			b = par[b][i];
	}
	if(a == b)
		return -1;
	int ans = a;
	for(int i = LG-1; i >= 0; i--){
		if(par[a][i] != par[b][i])
			ans = par[ans][i];
	}
	return ans;
}

void query(int l, int r){ //stores ans in st[0]. uses st[est] too!
	st[0].clear();
	while(l <= r){
		if(l & 1){
			merge(st[0], st[l], st[est]);
			st[0].swap(st[est]);
			l++;
		}
		if(r+1&1){
			merge(st[0], st[r], st[est]);
			st[0].swap(st[est]);
			r--;
		}
		l >>= 1; r >>= 1;
	}
}

void ask(int bg, int ed){ //stores ans in st[est-1]. uses st[est] and st[0] too!
	st[est-1].clear();
	while(hei[head[bg]] > hei[ed]){
		query(pos[head[bg]], pos[bg]);
		merge(st[0], st[est-1], st[est]);
		st[est-1].swap(st[est]);
		bg = par[head[bg]][0];
	}
	query(pos[head[bg]] + (hei[ed] - hei[head[bg]]), pos[bg]);
	merge(st[0], st[est-1], st[est]);
	st[est-1].swap(st[est]);
}

int main(){
	for(int i = 0; i < SST; i++)
		st[i].reserve(11);
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(1, 0, 1);
	decompose(1, 1);
	for(int i = 1; i <= m; i++){
		int a;
		scanf("%d", &a);
		if(st[pos[a]].size() < 10)
			st[pos[a]].push_back(i);
	}
	for(int i = HST-1; i; i--){
		int lch = i << 1;
		int rch = lch +1;
		merge(st[lch], st[rch], st[i]);
	}
	for(int _ = 0; _ < q; _++){
		int a, u, v;
		scanf("%d%d%d", &v, &u, &a);
		if(hei[u] > hei[v])
			swap(u, v);
		int pr = lca(u, v);
		if(pr == -1){
			ask(v, u);
			int tsz = min(a, int(st[est-1].size()));
			printf("%d ", tsz);
			for(int i = 0; i < tsz; i++)
				printf("%d ", st[est-1][i]);
		} else {
			ask(u, pr);
			st[est-2].swap(st[est-1]);
			ask(v, par[pr][0]);
			merge(st[est-2], st[est-1], st[est]);
			int tsz = min(a, int(st[est].size()));
			printf("%d ", tsz);
			for(int i = 0; i < tsz; i++)
				printf("%d ", st[est][i]);
		}
		puts("");
	}
}


#include <bits/stdc++.h>

#define in(x) scanf("%d", &x)
#define out(x) printf("%d ", x)
#define outln(x) printf("%d\n", x)

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
vector<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

vector<int> add(vector<int> s, vector<int> t)
{
    if (t.size() > 10)
        t.resize(10);

    for (int u : t)
        s.push_back(u);

    sort(s.begin(), s.end());
    s.resize(unique(s.begin(), s.end()) - s.begin());

    if (s.size() > 10)
        s.resize(10);
    return s;
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = add(sp[u][0], add(live[u], live[p]));
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        sp[u][i] = add(sp[u][i], sp[par[u][i - 1]][i - 1]);
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

vector<int> get(int u, int v)
{
    vector<int> res;
    res = add(res, live[u]), res = add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            res = add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            res = add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        res = add(res, live[par[u][0]]);
    return res;
}

int main()
{
    in(n), in(m), in(q);

    for (int i = 0, u, v; i < n - 1; i++)
        in(u), in(v), adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        in(x), live[x].push_back(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        in(u), in(v), in(a);

        vector<int> now = get(u, v);
        int x = min(a, (int)now.size());
        out(x);
        for (int i = 0; i < x; i++)
            out(now[i]);
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>

#define in(x) scanf("%d", &x)
#define out(x) printf("%d ", x)
#define outln(x) printf("%d\n", x)

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
set<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

set<int> get(set<int> s)
{
    set<int> res;
    int x = min(10, (int)s.size());
    for (int i = 0; i < x; i++)
        res.insert(*s.begin()), s.erase(s.begin());
    return res;
}

set<int> add(set<int> s, set<int> t)
{
    for (int u : t)
        s.insert(u);
    s = get(s);
    return s;
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = get(live[u]);
    sp[u][0] = add(sp[u][0], live[p]);
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        sp[u][i] = add(sp[u][i], get(sp[par[u][i - 1]][i - 1]));
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

set<int> get(int u, int v)
{
    set<int> res;
    res = add(res, live[u]), res = add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            res = add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            res = add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        res = add(res, live[par[u][0]]);
    return res;
}

int main()
{
    in(n), in(m), in(q);

    for (int i = 0, u, v; i < n - 1; i++)
        in(u), in(v), adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        in(x), live[x].insert(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        in(u), in(v), in(a);

        set<int> now = get(u, v);
        int x = min(a, (int)now.size());
        out(x);
        for (int i = 0; i < x; i++)
            out(*now.begin()), now.erase(now.begin());
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>

#define in(x) scanf("%d", &x)
#define out(x) printf("%d ", x)
#define outln(x) printf("%d\n", x)

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
vector<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

vector<int> get(vector<int> s)
{
    sort(s.begin(), s.end());
    s.resize(unique(s.begin(), s.end()) - s.begin());
    if (s.size() > 10)
        s.resize(10);
    return s;
}

vector<int> add(vector<int> s, vector<int> t)
{
    for (int u : t)
        s.push_back(u);
    s = get(s);
    return s;
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = get(live[u]);
    sp[u][0] = add(sp[u][0], live[p]);
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        sp[u][i] = add(sp[u][i], get(sp[par[u][i - 1]][i - 1]));
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

vector<int> get(int u, int v)
{
    vector<int> res;
    res = add(res, live[u]), res = add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            res = add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            res = add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        res = add(res, live[par[u][0]]);
    return res;
}

int main()
{
    in(n), in(m), in(q);

    for (int i = 0, u, v; i < n - 1; i++)
        in(u), in(v), adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        in(x), live[x].push_back(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        in(u), in(v), in(a);

        vector<int> now = get(u, v);
        int x = min(a, (int)now.size());
        out(x);
        for (int i = 0; i < x; i++)
            out(now[i]);
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>

#define in(x) scanf("%d", &x)
#define out(x) printf("%d ", x)
#define outln(x) printf("%d\n", x)

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
set<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

vector<int> get(vector<int> v)
{
    vector<int> res;
    for (int i = 0; i < min(10, (int)v.size()); i++)
        res.push_back(v[i]);
    return res;
}

set<int> get(set<int> s)
{
    set<int> res;
    for (int i = 0; i < min(10, (int)s.size()); i++)
        res.insert(*s.begin()), s.erase(s.begin());
    return res;
}

set<int> add(set<int> s, set<int> t)
{
    for (int u : t)
        s.insert(u);
    while (s.size() > 10)
        s.erase(s.rbegin().base());
    return s;
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = get(live[u]);
    sp[u][0] = add(sp[u][0], live[p]);
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        sp[u][i] = add(sp[u][i], get(sp[par[u][i - 1]][i - 1]));
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

set<int> get(int u, int v)
{
    set<int> res;
    res = add(res, live[u]), res = add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            res = add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            res = add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        res = add(res, live[par[u][0]]);
    return res;
}

int main()
{
    in(n), in(m), in(q);

    for (int i = 0, u, v; i < n - 1; i++)
        in(u), in(v), adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        in(x), live[x].insert(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        in(u), in(v), in(a);

        set<int> now = get(u, v);
        int x = min(a, (int)now.size());
        out(x);
        for (int i = 0; i < x; i++)
            out(*now.begin()), now.erase(now.begin());
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
set<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

vector<int> get(vector<int> v)
{
    vector<int> res;
    for (int i = 0; i < min(10, (int)v.size()); i++)
        res.push_back(v[i]);
    return res;
}

set<int> get(set<int> s)
{
    set<int> res;
    for (int i = 0; i < min(10, (int)s.size()); i++)
        res.insert(*s.begin()), s.erase(s.begin());
    return res;
}

void add(set<int> &s, set<int> t)
{
    for (int u : t)
        s.insert(u);
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = get(live[u]);
    add(sp[u][0], live[p]);
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        add(sp[u][i], get(sp[par[u][i - 1]][i - 1]));
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

set<int> get(int u, int v)
{
    set<int> res;
    add(res, live[u]), add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        add(res, live[par[u][0]]);
    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n >> m >> q;

    for (int i = 0, u, v; i < n - 1; i++)
        cin >> u >> v, adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        cin >> x, live[x].insert(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        cin >> u >> v >> a;

        set<int> now = get(u, v);
        int x = min(a, (int)now.size());
        cout << x << ' ';
        for (int i = 0; i < x; i++)
            cout << *now.begin() << ' ', now.erase(now.begin());
        cout << '\n';
    }

    return 0;
}


#include <bits/stdc++.h>

#define in(x) scanf("%d", &x)
#define out(x) printf("%d ", x)
#define outln(x) printf("%d\n", x)

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
set<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

vector<int> get(vector<int> v)
{
    vector<int> res;
    for (int i = 0; i < min(10, (int)v.size()); i++)
        res.push_back(v[i]);
    return res;
}

set<int> get(set<int> s)
{
    set<int> res;
    for (int i = 0; i < min(10, (int)s.size()); i++)
        res.insert(*s.begin()), s.erase(s.begin());
    return res;
}

void add(set<int> &s, set<int> t)
{
    for (int u : t)
        s.insert(u);
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = get(live[u]);
    add(sp[u][0], live[p]);
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        add(sp[u][i], get(sp[par[u][i - 1]][i - 1]));
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

set<int> get(int u, int v)
{
    set<int> res;
    add(res, live[u]), add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        add(res, live[par[u][0]]);
    return res;
}

int main()
{
    in(n), in(m), in(q);

    for (int i = 0, u, v; i < n - 1; i++)
        in(u), in(v), adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        in(x), live[x].insert(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        in(u), in(v), in(a);

        set<int> now = get(u, v);
        int x = min(a, (int)now.size());
        outln(x);
        for (int i = 0; i < x; i++)
            outln(*now.begin()), now.erase(now.begin());
        outln('\n');
    }

    return 0;
}


#include <bits/stdc++.h>

#define in(x) scanf("%d", &x)
#define out(x) printf("%d ", x)
#define outln(x) printf("%d\n", x)

using namespace std;

const int maxn = 1e5 + 10, maxl = 20;
int par[maxn][maxl], n, m, q;
int tin[maxn], tout[maxn], timer;
set<int> sp[maxn][maxl], live[maxn];
vector<int> adj[maxn];

vector<int> get(vector<int> v)
{
    vector<int> res;
    for (int i = 0; i < min(10, (int)v.size()); i++)
        res.push_back(v[i]);
    return res;
}

set<int> get(set<int> s)
{
    set<int> res;
    for (int i = 0; i < min(10, (int)s.size()); i++)
        res.insert(*s.begin()), s.erase(s.begin());
    return res;
}

void add(set<int> &s, set<int> t)
{
    for (int u : t)
        s.insert(u);
}

void dfs(int u = 1, int p = 1)
{
    par[u][0] = p;
    sp[u][0] = get(live[u]);
    add(sp[u][0], live[p]);
    for (int i = 1; i < maxl; i++)
    {
        par[u][i] = par[par[u][i - 1]][i - 1];
        sp[u][i] = sp[u][i - 1];
        add(sp[u][i], get(sp[par[u][i - 1]][i - 1]));
    }

    tin[u] = timer++;

    for (int v : adj[u])
        if (v != p)
            dfs(v, u);

    tout[u] = timer++;
}

bool is_anc(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

set<int> get(int u, int v)
{
    set<int> res;
    add(res, live[u]), add(res, live[v]);
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[u][i], v))
        {
            add(res, sp[u][i]);
            u = par[u][i];
        }
    for (int i = maxl - 1; ~i; i--)
        if (!is_anc(par[v][i], u))
        {
            add(res, sp[v][i]);
            v = par[v][i];
        }

    if ((!is_anc(u, v)) && (!is_anc(v, u)))
        add(res, live[par[u][0]]);
    return res;
}

int main()
{
    in(n), in(m), in(q);

    for (int i = 0, u, v; i < n - 1; i++)
        in(u), in(v), adj[u].push_back(v), adj[v].push_back(u);
    for (int i = 0, x; i < m; i++)
        in(x), live[x].insert(i + 1);
    dfs();

    while (q--)
    {
        int u, v, a;
        in(u), in(v), in(a);

        set<int> now = get(u, v);
        int x = min(a, (int)now.size());
        out(x);
        for (int i = 0; i < x; i++)
            out(*now.begin()), now.erase(now.begin());
        printf("\n");
    }

    return 0;
}