#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 7;
int n, k, d, u, v, x, y, p[N], protection[N];
vector<int> graph[N], ans;
pair<int, int> edges[N];
queue<int> q;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> d;
  for (int i = 1; i <= (int)k; i++) {
    cin >> x;
    if (p[x]) continue;
    p[x] = 1;
    protection[x] = x;
    q.push(x);
  }
  for (int i = 1; i <= (int)n - 1; i++) {
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
    edges[i] = {u, v};
  }
  while (!q.empty()) {
    x = q.front();
    q.pop();
    for (auto y : graph[x]) {
      if (!protection[y]) {
        protection[y] = protection[x];
        q.push(y);
      }
    }
  }
  for (int i = 1; i <= (int)n - 1; i++) {
    if (protection[edges[i].first] != protection[edges[i].second]) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  for (auto x : ans) {
    cout << x << " ";
  }
  return 0;
}
