#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to;
} E[600010 * 2];
int que[600010], dis[600010], ans, vis[600010 * 2];
int police[600010], edge_cnt, anss[600010];
int n, m, k, ne[600010 * 2], last[600010];
void add(int x, int y) {
  E[++edge_cnt].from = x;
  E[edge_cnt].to = y;
  ne[edge_cnt] = last[x];
  last[x] = edge_cnt;
}
void Insert() {
  int x, y;
  scanf("%d %d", &x, &y);
  add(x, y);
  add(y, x);
}
void bfs() {
  int head = 1, tail = 0;
  int u, v;
  memset(dis, 0x7f, sizeof(dis));
  for (int i = 1; i <= m; i++) {
    que[++tail] = police[i];
    dis[police[i]] = 0;
  }
  while (head <= tail) {
    u = que[head];
    for (int j = last[u]; j; j = ne[j]) {
      int v = E[j].to;
      if (vis[(j + 1) / 2]) continue;
      if (dis[v] > dis[u] + 1 && dis[u] < k) {
        vis[(j + 1) / 2] = 1;
        dis[v] = dis[u] + 1;
        que[++tail] = v;
      }
      if (dis[v] <= dis[u]) {
        vis[(j + 1) / 2] = 1;
        anss[++ans] = (j + 1) / 2;
      }
    }
    head++;
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) scanf("%d", &police[i]);
  for (int i = 1; i <= n - 1; i++) Insert();
  bfs();
  cout << ans << endl;
  for (int i = 1; i <= ans; i++) printf("%d ", anss[i]);
  return 0;
}
