#include <bits/stdc++.h>
using namespace std;
struct Node {
  Node() : vis(0) {}
  int vis;
  vector<pair<int, int>> adj;
};
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t n, k, d;
  cin >> n >> k >> d;
  queue<pair<int, int>> q;
  for (int i = 0; i < k; i++) {
    int v;
    cin >> v;
    v--;
    q.push({v, i + 1});
  }
  vector<Node> a(n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    a[u].adj.push_back({v, i + 1});
    a[v].adj.push_back({u, i + 1});
  }
  while (!q.empty()) {
    int u = q.front().first;
    int c = q.front().second;
    q.pop();
    if (a[u].vis != 0) continue;
    a[u].vis = c;
    for (auto pv : a[u].adj) {
      if (a[pv.first].vis == 0) {
        q.push({pv.first, c});
      }
    }
  }
  vector<int> res;
  for (int u = 0; u < n; u++) {
    for (auto pv : a[u].adj) {
      if (a[pv.first].vis != a[u].vis) res.push_back(pv.second);
    }
  }
  sort(res.begin(), res.end());
  res.erase(unique(res.begin(), res.end()), res.end());
  cout << res.size() << endl;
  for (auto e : res) {
    cout << e << " ";
  }
  cout << endl;
  return 0;
}
