#include <bits/stdc++.h>
using namespace std;
int n, k, d, pred[400000];
vector<pair<int, int> > a[400000];
vector<int> ans;
bool b[400000], rebr[400000];
queue<int> q;
int main() {
  int i, x, y;
  cin >> n >> k >> d;
  for (i = 1; i <= n; i++) {
    b[i] = false;
    rebr[i] = false;
  }
  for (i = 1; i <= k; i++) {
    cin >> x;
    if (!b[x]) {
      b[x] = true;
      q.push(x);
    }
  }
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    a[x].push_back(make_pair(y, i));
    a[y].push_back(make_pair(x, i));
  }
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (i = 0; i < a[v].size(); i++) {
      int to = a[v][i].first;
      if (b[to]) {
        if (to != pred[v] && !rebr[a[v][i].second]) {
          ans.push_back(a[v][i].second);
          rebr[a[v][i].second] = true;
        }
      } else {
        q.push(to);
        pred[to] = v;
        b[to] = true;
      }
    }
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
