#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve() {
  int n, k, d;
  cin >> n >> k >> d;
  vector<int> dist(n, -1);
  vector<vector<pair<int, int>>> za(n);
  vector<int> keep(n - 1), par(n);
  queue<int> q;
  for (int i = (0); i < (k); ++i) {
    int p;
    cin >> p;
    --p;
    dist[p] = 0;
    q.push(p);
    par[p] = -1;
  }
  for (int i = (0); i < (n - 1); ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    za[x].emplace_back(y, i);
    za[y].emplace_back(x, i);
  }
  int res = 0;
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    for (auto edge : za[cur]) {
      int u = edge.first;
      int edge_no = edge.second;
      if (dist[u] == -1) {
        ++res;
        dist[u] = dist[cur] + 1;
        keep[edge_no] = 1;
        q.push(u);
      }
    }
  }
  vector<int> shut;
  for (int i = (0); i < (n - 1); ++i) {
    if (keep[i] == 0) {
      shut.push_back(i + 1);
    }
  }
  cout << ((int)((shut).size())) << endl;
  for (auto s : shut) {
    cout << s << ' ';
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
