#include <bits/stdc++.h>
using namespace std;
int v[500000];
int ans[500000];
queue<pair<int, int> > q;
vector<pair<int, int> > p[500000];
int main() {
  int n, k, d, x, y;
  int i, j;
  cin >> n >> k >> d;
  for (i = 0; i < k; i++) {
    cin >> x;
    q.push(make_pair(x, 0));
  }
  for (i = 0; i < n - 1; i++) {
    cin >> x >> y;
    p[x].push_back(make_pair(y, i + 1));
    p[y].push_back(make_pair(x, i + 1));
  }
  while (!(q.empty())) {
    int l, r;
    l = q.front().first;
    r = q.front().second;
    q.pop();
    if (v[l] == 1) continue;
    v[l] = 1;
    for (i = 0; i < p[l].size(); i++) {
      if (p[l][i].first != r) {
        if (v[p[l][i].first] == 1)
          ans[p[l][i].second] = 1;
        else
          q.push(make_pair(p[l][i].first, l));
      }
    }
  }
  int c = 0;
  for (i = 1; i <= n - 1; i++) {
    if (ans[i]) c++;
  }
  cout << c << endl;
  for (i = 1; i <= n - 1; i++) {
    if (ans[i]) cout << i << " ";
  }
  cout << endl;
}
