#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3fll;
const long long M = 1e9 + 7;
const long long maxn = 3e6 + 7;
const double eps = 0.00000001;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
int n, k, d;
int i, j, t;
int a[maxn];
vector<int> edge[maxn];
int from[maxn];
bool ans[maxn], mark[maxn];
int num;
queue<int> Q;
int u, v;
int XOR[maxn];
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (i = 1; i <= k; i++) {
    scanf("%d", &j);
    if (!mark[j]) Q.push(j);
    mark[j] = 1;
  }
  for (i = 1; i <= n; i++) ans[i] = 0;
  for (i = 1; i <= n - 1; i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(i);
    edge[v].push_back(i);
    XOR[i] = u ^ v;
  }
  while (!Q.empty()) {
    u = Q.front();
    Q.pop();
    for (i = 0; i < edge[u].size(); i++) {
      t = edge[u][i];
      v = XOR[t] ^ u;
      if (from[u] == v) continue;
      if (mark[v])
        ans[t] = 1;
      else {
        from[v] = u;
        mark[v] = 1;
        Q.push(v);
      }
    }
  }
  for (i = 1; i <= n; i++) num += ans[i];
  printf("%d\n", num);
  for (i = 1; i <= n; i++)
    if (ans[i]) printf("%d ", i);
}
