#include <bits/stdc++.h>
using namespace std;
const long long MaxN = 300005;
long long n, k, d, head[MaxN], cntEdge, cntColour, c[MaxN], ans[MaxN],
    cntAnswer;
long long fr[MaxN], to[MaxN];
struct Edge {
  long long destiantion, nextEdge;
} edge[MaxN * 2];
struct City {
  long long serial, colour;
};
queue<City> q;
inline long long Read() {
  long long num = 0, op = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    num = num * 10 + ch - '0';
    ch = getchar();
  }
  return num * op;
}
inline void AddEdge(long long u, long long v) {
  cntEdge++;
  edge[cntEdge].destiantion = v;
  edge[cntEdge].nextEdge = head[u];
  head[u] = cntEdge;
  return;
}
inline void BFS() {
  while (q.size()) {
    City x = q.front();
    q.pop();
    for (long long i = head[x.serial]; i; i = edge[i].nextEdge) {
      long long y = edge[i].destiantion;
      if (!c[y]) {
        c[y] = x.colour;
        q.push((City){y, x.colour});
      }
    }
  }
  return;
}
signed main() {
  n = Read(), k = Read(), d = Read();
  for (long long i = 1; i <= k; i++) {
    long long x = Read();
    if (!c[x]) {
      c[x] = ++cntColour;
      q.push((City){x, cntColour});
    }
  }
  for (long long i = 1; i < n; i++) {
    fr[i] = Read(), to[i] = Read();
    AddEdge(fr[i], to[i]), AddEdge(to[i], fr[i]);
  }
  BFS();
  for (long long i = 1; i < n; i++) {
    if (c[fr[i]] != c[to[i]]) ans[++cntAnswer] = i;
  }
  printf("%lld\n", cntAnswer);
  for (long long i = 1; i <= cntAnswer; i++) printf("%lld ", ans[i]);
  return 0;
}
