#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
vector<int> E[MAXN];
map<pair<int, int>, bool> iskey;
queue<int> q;
int N, K, D, dis[MAXN], ans = 0;
pair<int, int> e[MAXN];
int main() {
  scanf("%d%d%d", &N, &K, &D);
  memset(dis, 0x3f, sizeof(dis));
  for (int i = 1; i <= K; i++) {
    int p;
    scanf("%d", &p);
    dis[p] = 0;
    q.push(p);
  }
  for (int i = 1; i <= N - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    E[x].push_back(y);
    E[y].push_back(x);
    if (x > y) swap(x, y);
    e[i] = make_pair(x, y);
  }
  while (!q.empty()) {
    int node = q.front();
    q.pop();
    for (int i = 0; i <= (int)E[node].size() - 1; i++) {
      if (dis[E[node][i]] > D) {
        dis[E[node][i]] = dis[node] + 1;
        q.push(E[node][i]);
        iskey[make_pair(min(node, E[node][i]), max(node, E[node][i]))] = 1;
      }
    }
  }
  for (int i = 1; i <= N - 1; i++)
    if (!iskey[e[i]]) ans++;
  cout << ans << endl;
  for (int i = 1; i <= N - 1; i++)
    if (!iskey[e[i]]) {
      printf("%d ", i);
    }
  puts("");
  return 0;
}
