#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, len, ans = 0;
  cin >> n >> k >> len;
  vector<char> ch(n);
  vector<pair<int, int>> r(n - 1);
  vector<list<int>> g(n);
  set<pair<int, int>> deleted;
  queue<int> q;
  int t1, t2, v;
  for (int i = 0; i < k; i++) {
    cin >> t1;
    t1--;
    if (ch[t1]) continue;
    q.push(t1);
    ch[t1] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> t1 >> t2;
    t1--;
    t2--;
    g[t1].push_back(t2);
    g[t2].push_back(t1);
    r[i] = make_pair(t1, t2);
  }
  while (!q.empty()) {
    v = q.front();
    q.pop();
    ch[v] = 2;
    for (int to : g[v]) {
      if (ch[to] == 1) {
        deleted.insert(make_pair(v, to));
        ans++;
      } else if (ch[to] == 0) {
        ch[to] = 1;
        q.push(to);
      }
    }
  }
  cout << ans << endl;
  for (int i = 0; i < n - 1; i++)
    if (deleted.find(r[i]) != deleted.end() ||
        deleted.find(make_pair(r[i].second, r[i].first)) != deleted.end()) {
      cout << i + 1 << " ";
    }
}
