#include <bits/stdc++.h>
using namespace std;
int const N = 5e5 + 1;
int n, k, dd, v[N], a[N], b[N], d[N];
map<int, int> mp[N], viss[N];
vector<int> g[N];
vector<int> an;
bool vis[N];
queue<int> q;
void bfs() {
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    if (d[x] == dd) continue;
    for (int i = 0; i < g[x].size(); ++i) {
      int y = g[x][i];
      if (!vis[y]) {
        d[y] = d[x] + 1;
        vis[y] = 1;
        q.push(y);
        viss[x][y] = 1;
        viss[y][x] = 1;
      }
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &k, &dd);
  for (int i = 0; i < k; ++i) {
    int x;
    scanf("%d", &x);
    v[--x] = 1;
    q.push(x);
    d[x] = 0;
    vis[x] = 1;
  }
  for (int i = 0, u, v; i < n - 1; ++i) {
    scanf("%d%d", &u, &v);
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
    mp[u][v] = i + 1;
    mp[v][u] = i + 1;
    a[i] = u, b[i] = v;
  }
  bfs();
  for (int i = 0; i < n - 1; ++i) {
    if (!viss[a[i]][b[i]]) an.push_back(i + 1);
  }
  printf("%d\n", an.size());
  for (auto i : an) cout << i << " ";
}
