#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
int n, k, d;
int dist[N];
int color[N];
vector<int> adj[N];
map<pair<int, int>, int> id;
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(dist, -1, sizeof(dist));
  cin >> n >> k >> d;
  queue<int> Q;
  while (k--) {
    int p;
    cin >> p;
    dist[p] = 0;
    Q.push(p);
  }
  for (int i = 1; i <= n; i++) color[i] = i;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
    id[make_pair(min(x, y), max(x, y))] = i + 1;
  }
  while (!Q.empty()) {
    int x = Q.front();
    Q.pop();
    if (1 + dist[x] > d) continue;
    for (int i = 0; i < (int)adj[x].size(); i++) {
      int y = adj[x][i];
      if (dist[y] == -1) {
        dist[y] = 1 + dist[x];
        Q.push(y);
        color[y] = color[x];
      }
    }
  }
  set<int> edges;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (int)adj[i].size(); j++) {
      if (color[i] != color[adj[i][j]]) {
        edges.insert(id[make_pair(min(i, adj[i][j]), max(i, adj[i][j]))]);
      }
    }
  }
  cout << (int)edges.size() << endl;
  for (auto e : edges) cout << e << " ";
  cout << endl;
  return 0;
}
