#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int n, m, q, t = 0;
set<int> s[100010];
int baseArray[100010], pa[20][100010], ptr, chainNo;
vector<int> chainInd(100010), chainHead(100010, -1), posInBase(100010);
vector<int> depth(100010), subsize(100010),
    cost(100010, 1000000000), graph[100010];
vector<int> arrival(100010), prefix(2 * 100010), euler, refer(100010, -1);
vector<pair<int, int> > answer;
struct SegmentTreeNode {
  int mini;
  void assignLeaf(int value) { mini = value; }
  void merge(SegmentTreeNode& left, SegmentTreeNode& right) {
    mini = min(left.mini, right.mini);
  }
  int getValue() { return mini; }
};
SegmentTreeNode nodes[4 * 100010];
class SegmentTree {
 public:
  void build(int num) { buildTree(1, 0, num - 1); }
  int getValue(int lo, int hi, int num) {
    SegmentTreeNode result = getValue(1, 0, num - 1, lo, hi);
    return result.getValue();
  }
  void update(int index, int value, int num) {
    update(1, 0, num - 1, index, value);
  }

 private:
  void buildTree(int stIndex, int lo, int hi) {
    if (lo == hi) {
      nodes[stIndex].assignLeaf(baseArray[lo]);
      return;
    }
    int left = 2 * stIndex, right = left + 1, mid = (lo + hi) / 2;
    buildTree(left, lo, mid);
    buildTree(right, mid + 1, hi);
    nodes[stIndex].merge(nodes[left], nodes[right]);
  }
  SegmentTreeNode getValue(int stIndex, int left, int right, int lo, int hi) {
    if (left == lo && right == hi) return nodes[stIndex];
    int mid = (left + right) / 2;
    if (lo > mid) return getValue(2 * stIndex + 1, mid + 1, right, lo, hi);
    if (hi <= mid) return getValue(2 * stIndex, left, mid, lo, hi);
    SegmentTreeNode leftResult = getValue(2 * stIndex, left, mid, lo, mid);
    SegmentTreeNode rightResult =
        getValue(2 * stIndex + 1, mid + 1, right, mid + 1, hi);
    SegmentTreeNode result;
    result.merge(leftResult, rightResult);
    return result;
  }
  void update(int stIndex, int lo, int hi, int index, int value) {
    if (lo == hi) {
      nodes[stIndex].assignLeaf(value);
      return;
    }
    int left = 2 * stIndex, right = left + 1, mid = (lo + hi) / 2;
    if (index <= mid)
      update(left, lo, mid, index, value);
    else
      update(right, mid + 1, hi, index, value);
    nodes[stIndex].merge(nodes[left], nodes[right]);
  }
};
SegmentTree st;
int query_up(int u, int v) {
  int qt;
  int uchain, vchain = chainInd[v], ans = 1000000000;
  if (u == v) ans = st.getValue(posInBase[v], posInBase[u], ptr);
  while (1) {
    uchain = chainInd[u];
    if (uchain == vchain) {
      qt = st.getValue(posInBase[v], posInBase[u], ptr);
      if (qt < ans) ans = qt;
      break;
    }
    qt = st.getValue(posInBase[chainHead[uchain]], posInBase[u], ptr);
    if (qt < ans) ans = qt;
    u = chainHead[uchain];
    u = pa[0][u];
  }
  return ans;
}
int LCA(int u, int v) {
  if (depth[u] < depth[v]) swap(u, v);
  int diff = depth[u] - depth[v];
  for (int i = 0; i < 20; i++) {
    if ((diff >> i) & 1) u = pa[i][u];
  }
  if (u == v) return u;
  for (int i = 20 - 1; i >= 0; i--) {
    if (pa[i][u] != pa[i][v]) {
      u = pa[i][u];
      v = pa[i][v];
    }
  }
  return pa[0][u];
}
int query(int u, int v) {
  int lca = LCA(u, v);
  int ans = query_up(u, lca);
  int temp = query_up(v, lca);
  if (temp < ans) ans = temp;
  return ans;
}
void change(int u, int val) { st.update(posInBase[u], val, ptr); }
void HLD(int curNode, int prev) {
  if (chainHead[chainNo] == -1) chainHead[chainNo] = curNode;
  chainInd[curNode] = chainNo;
  posInBase[curNode] = ptr;
  baseArray[ptr++] = cost[curNode];
  int sc = -1;
  for (int i = 0; i < (int)(graph[curNode].size()); i++) {
    if (graph[curNode][i] != prev) {
      if (sc == -1 || subsize[sc] < subsize[graph[curNode][i]])
        sc = graph[curNode][i];
    }
  }
  if (sc != -1) HLD(sc, curNode);
  for (int i = 0; i < graph[curNode].size(); i++) {
    if (graph[curNode][i] != prev) {
      if (sc != graph[curNode][i]) {
        chainNo++;
        HLD(graph[curNode][i], curNode);
      }
    }
  }
}
void dfs(int cur, int prev, int _depth = 0) {
  pa[0][cur] = prev;
  depth[cur] = _depth;
  subsize[cur] = 1;
  for (int i = 0; i < (int)(graph[cur].size()); i++) {
    if (graph[cur][i] != prev) {
      dfs(graph[cur][i], cur, _depth + 1);
      subsize[cur] += subsize[graph[cur][i]];
    }
  }
}
void dfs1(int cur, int prev) {
  euler.push_back((int)(s[cur].size()));
  arrival[cur] = t++;
  for (int i = 0; i < (int)(graph[cur].size()); i++) {
    if (graph[cur][i] != prev) dfs1(graph[cur][i], cur);
  }
  t++;
  euler.push_back(-(int)(s[cur].size()));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> q;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (int i = 1; i < m + 1; i++) {
    int c;
    cin >> c;
    c--;
    s[c].insert(i);
    cost[c] = min(cost[c], i);
    refer[i] = c;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 20; j++) pa[j][i] = -1;
  }
  ptr = 0;
  chainNo = 0;
  dfs(0, -1);
  HLD(0, -1);
  st.build(ptr);
  for (int i = 1; i < 20; i++) {
    for (int j = 0; j < n; j++) {
      if (pa[i - 1][j] != -1) pa[i][j] = pa[i - 1][pa[i - 1][j]];
    }
  }
  dfs1(0, -1);
  prefix[0] = euler[0];
  for (int i = 1; i < (int)(euler.size()); i++)
    prefix[i] = prefix[i - 1] + euler[i];
  for (int i = 0; i < q; i++) {
    answer.clear();
    int u, v, a, k;
    cin >> u >> v >> a;
    u--;
    v--;
    int lca = LCA(u, v);
    if (lca == 0)
      k = prefix[arrival[u]] + prefix[arrival[v]] - prefix[arrival[lca]];
    else
      k = prefix[arrival[u]] + prefix[arrival[v]] - prefix[arrival[lca]] -
          prefix[arrival[pa[0][lca]]];
    a = min(a, k);
    for (int j = 1; j < a + 1; j++) {
      int result = query(u, v);
      int node = refer[result];
      answer.push_back(make_pair(result, node));
      s[node].erase(result);
      if ((int)(s[node].size()) == 0)
        change(node, 1000000000);
      else
        change(node, *(s[node].begin()));
    }
    cout << a << " ";
    for (int j = 0; j < (int)(answer.size()); j++) {
      cout << answer[j].first << " ";
      s[answer[j].second].insert(answer[j].first);
      change(answer[j].second, *(s[answer[j].second].begin()));
    }
    cout << "\n";
  }
  return 0;
}
