#include <bits/stdc++.h>
using namespace std;
int n, k, d, fix[300005], a, b, ans, p[300005], mp1[300005];
queue<int> q;
vector<pair<int, int> > v[300005];
set<int> s[300005];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> k >> d;
  for (int i = 1; i <= k; i++) {
    cin >> a;
    if (!fix[a]) {
      q.push(a);
      ans++;
    }
    fix[a] = 1;
  }
  cout << ans - 1 << endl;
  for (int i = 1; i <= n - 1; i++) {
    cin >> a >> b;
    v[a].push_back({b, i});
    v[b].push_back({a, i});
  }
  while (q.size()) {
    a = q.front();
    q.pop();
    for (int i = 0; i < v[a].size(); i++) {
      if (v[a][i].first == p[a]) continue;
      if (fix[v[a][i].first] == 1) {
        mp1[v[a][i].second] = 1;
      } else {
        p[v[a][i].first] = a;
        q.push(v[a][i].first);
        fix[v[a][i].first] = 1;
      }
    }
  }
  for (int i = 1; i <= n - 1; i++)
    if (mp1[i]) cout << i << " ";
  cout << endl;
  ;
}
