#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
int n, k, d;
queue<pair<int, int> > q;
int h[N], e[N << 1], ne[N << 1], idx;
int num[N];
int u[N], v[N];
void add(int a, int b) { e[idx] = b, ne[idx] = h[a], h[a] = idx++; }
void bfs() {
  int x, y;
  while (!q.empty()) {
    x = q.front().first;
    y = q.front().second;
    q.pop();
    for (int i = h[x]; i != -1; i = ne[i]) {
      int v = e[i];
      if (num[v]) continue;
      num[v] = y;
      q.push({v, y});
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &k, &d);
  int x, id = 0;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x);
    if (num[x]) continue;
    q.push({x, ++id});
    num[x] = id;
  }
  memset(h, -1, sizeof h);
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d%d", &u[i], &v[i]);
    add(u[i], v[i]);
    add(v[i], u[i]);
  }
  bfs();
  int res = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (num[u[i]] != num[v[i]]) res++;
  }
  printf("%d\n", res);
  for (int i = 1; i <= n - 1; i++) {
    if (num[u[i]] != num[v[i]]) printf("%d ", i);
  }
}
