#include <bits/stdc++.h>
using namespace std;
int N, K, D, st[300005], dr[300005], city[300005], ans;
vector<pair<int, int> > L[300005];
bool used[300005];
queue<int> q;
inline void Read() {
  int i, x, y;
  cin >> N >> K >> D;
  for (i = 1; i <= K; i++) {
    cin >> x;
    if (!used[x]) {
      ans++;
      q.push(x);
      used[x] = 1;
      city[x] = x;
    }
  }
  for (i = 1; i < N; i++) {
    cin >> x >> y;
    st[i] = x;
    dr[i] = y;
    L[x].push_back({y, i});
    L[y].push_back({x, i});
  }
}
inline void Solve() {
  int nod;
  while (!q.empty()) {
    nod = q.front();
    q.pop();
    for (auto it : L[nod]) {
      if (!used[it.first]) {
        used[it.first] = 1;
        q.push(it.first);
        city[it.first] = city[nod];
      }
    }
  }
}
inline void Write() {
  int i;
  cout << ans - 1 << "\n";
  for (i = 1; i <= N; i++) {
    if (city[st[i]] != city[dr[i]]) {
      cout << i << " ";
    }
  }
}
int main() {
  Read();
  Solve();
  Write();
  return 0;
}
