#include <bits/stdc++.h>
using namespace std;
int n, k, dd, num[300005], nn, ans[300005], an;
vector<int> eg[300005], egid[300005];
bool vis[300005] = {0}, vis2[300005] = {0}, vis3[300005] = {0},
     vis4[300005] = {0};
struct node {
  int u, d, pr;
};
queue<struct node> q;
void bfs() {
  while (!q.empty()) {
    struct node u = q.front();
    q.pop();
    if (u.d > dd) {
      if (!vis2[u.pr]) vis2[u.pr] = 1, ans[++an] = u.pr;
      continue;
    }
    for (int i = 0; i < eg[u.u].size(); i++) {
      int v = eg[u.u][i];
      int id = egid[u.u][i];
      if (vis4[id]) continue;
      vis4[id] = 1;
      int d = u.d + 1;
      if (!vis3[v]) {
        vis3[v] = 1;
        struct node tmp;
        tmp.u = v;
        tmp.pr = id;
        tmp.d = d;
        q.push(tmp);
      } else {
        if (!vis2[id]) vis2[id] = 1, ans[++an] = id;
      }
    }
  }
}
int main() {
  an = 0;
  nn = 0;
  scanf("%d%d%d", &n, &k, &dd);
  for (int i = 1, a; i <= k; i++) {
    scanf("%d", &a);
    vis[a] = 1;
    num[++nn] = a;
  }
  for (int i = 1, a, b; i < n; i++) {
    scanf("%d%d", &a, &b);
    eg[a].push_back(b);
    egid[a].push_back(i);
    eg[b].push_back(a);
    egid[b].push_back(i);
  }
  for (int i = 1; i <= nn; i++) {
    struct node tmp;
    tmp.u = num[i];
    tmp.d = 0;
    tmp.pr = -1;
    vis3[num[i]] = 1;
    q.push(tmp);
  }
  bfs();
  sort(ans + 1, ans + 1 + an);
  printf("%d\n", an);
  for (int i = 1; i <= an; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
