#include <bits/stdc++.h>
using namespace std;
int has[300005];
vector<pair<int, int> > adj[300005];
int shut[300005];
bool vis[300005];
int dis[300005];
int p[300005];
int main() {
  int n, k, d;
  scanf("%d %d %d", &n, &k, &d);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    has[x] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    adj[u].push_back(pair<int, int>(v, i + 1));
    adj[v].push_back(pair<int, int>(u, i + 1));
    dis[i + 1] = 1e9;
  }
  queue<int> Q;
  for (int i = 1; i <= n; i++)
    if (has[i]) {
      vis[i] = 1;
      dis[i] = 0;
      Q.push(i);
    }
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    if (dis[u] > d) break;
    for (auto x : adj[u]) {
      int v = x.first, id = x.second;
      if (v == p[u]) continue;
      if (!vis[v]) {
        vis[v] = 1;
        p[v] = u;
        dis[v] = dis[u] + 1;
        Q.push(v);
      } else {
        shut[id] = 1;
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (shut[i]) cnt++;
  printf("%d\n", cnt);
  for (int i = 1; i <= n; i++)
    if (shut[i]) printf("%d\n", i);
  return 0;
}
