#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
vector<int> g[N];
int n, k, d;
int cmp[N];
int u[N], v[N];
int main() {
  queue<int> q;
  cin >> n >> k >> d;
  for (int i = 0; i < k; i++) {
    int p;
    cin >> p;
    cmp[p] = p;
    q.push(p);
  }
  for (int i = 1; i <= n - 1; i++) {
    cin >> u[i] >> v[i];
    g[u[i]].push_back(v[i]);
    g[v[i]].push_back(u[i]);
  }
  while (not q.empty()) {
    int u = q.front();
    q.pop();
    for (auto v : g[u]) {
      if (cmp[v] == 0) {
        cmp[v] = cmp[u];
        q.push(v);
      }
    }
  }
  vector<int> ans;
  for (int i = 1; i <= n - 1; i++) {
    if (cmp[u[i]] != cmp[v[i]]) ans.push_back(i);
  }
  cout << ans.size() << '\n';
  for (auto x : ans) cout << x << ' ';
}
