#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
int dx[] = {-1, 0, 0, 1, -1, -1, 1, 1};
int dy[] = {0, -1, +1, 0, -1, +1, -1, +1};
int n, k, d;
int dist[303030];
int v[303030];
vector<pair<int, int> > g[303030];
int u[303030];
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  cin >> n >> k >> d;
  queue<int> Q;
  for (int(i) = 0; (i) < (303030); (i)++) dist[i] = -1;
  for (int(i) = 0; (i) < (k); (i)++) {
    int x;
    cin >> x;
    Q.push(x);
    dist[x] = d;
  }
  memset(u, 0, sizeof(u));
  ;
  for (int(i) = 0; (i) < (n - 1); (i)++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(pair<int, int>(y, i));
    g[y].push_back(pair<int, int>(x, i));
  }
  int ans = n - 1;
  while (!Q.empty()) {
    int z = Q.front();
    Q.pop();
    if (dist[z] == 0) continue;
    for (__typeof(g[z].begin()) e = g[z].begin(); e != g[z].end(); e++) {
      if (dist[e->first] < 0) {
        dist[e->first] = dist[z] - 1;
        Q.push(e->first);
        u[e->second] = 1;
        ans--;
      }
    }
  }
  cout << ans << '\n';
  for (int(i) = 0; (i) < (n - 1); (i)++)
    if (u[i] == 0) cout << i + 1 << '\n';
}
