#include <bits/stdc++.h>
const int INF = 2147483647;
using namespace std;
class Node {
 public:
  int pred, dist;
  bool visited, isStation;
  Node() : pred(0), dist(0), visited(false), isStation(false) {}
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, d;
  cin >> n >> k >> d;
  vector<set<int>> tree(n + 1);
  vector<Node> nodes(n + 1);
  map<pair<int, int>, int> roads;
  vector<int> stations;
  for (int i = 0; i < k; i++) {
    int num;
    cin >> num;
    stations.push_back(num);
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    tree[x].insert(y);
    tree[y].insert(x);
    roads.insert(make_pair(make_pair(x, y), i));
    roads.insert(make_pair(make_pair(y, x), i));
  }
  for (int i : stations) {
    nodes[i].isStation = true;
    nodes[i].visited = true;
    nodes[i].pred = i;
  }
  sort(stations.begin(), stations.end());
  auto it = unique(stations.begin(), stations.end());
  stations.resize(it - stations.begin());
  k = stations.size();
  bool done = false;
  vector<int> ans;
  queue<int> q;
  for (int i : stations) {
    q.push(i);
    nodes[i].visited = true;
  }
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    vector<int> toKill;
    for (int i : tree[cur]) {
      if (!nodes[i].visited) {
        nodes[i].visited = true;
        nodes[i].pred = nodes[cur].pred;
        q.push(i);
      } else if (nodes[i].pred != nodes[cur].pred) {
        toKill.push_back(i);
      }
    }
    for (int i : toKill) {
      tree[i].erase(cur);
      tree[cur].erase(i);
      ans.push_back(roads.find(make_pair(cur, i))->second);
    }
  }
  cout << ans.size() << endl;
  for (int i : ans) {
    cout << i << " ";
  }
  return 0;
}
