#include <bits/stdc++.h>
using namespace std;
int n, k, d, x, y, sm[300005];
bool bo[300005], l[300005];
vector<pair<int, int> > v[300005];
vector<int> p;
queue<int> q;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> k >> d;
  for (int i = 0; i < k; ++i) {
    cin >> x;
    bo[x] = 1;
    sm[x] = x;
    q.push(x);
  }
  for (int i = 1; i < n; ++i) {
    cin >> x >> y;
    v[x].push_back({y, i});
    v[y].push_back({x, i});
  }
  while (q.size()) {
    int dg = q.front();
    q.pop();
    for (int i = 0; i < v[dg].size(); ++i) {
      if (!bo[v[dg][i].first]) {
        bo[v[dg][i].first] = 1;
        sm[v[dg][i].first] = sm[dg];
        q.push(v[dg][i].first);
      } else if (sm[v[dg][i].first] != sm[dg] && !l[v[dg][i].second]) {
        l[v[dg][i].second] = 1;
        p.push_back(v[dg][i].second);
      }
    }
  }
  cout << p.size() << endl;
  for (int i = 0; i < p.size(); ++i) {
    cout << p[i] << " ";
  }
}
