#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 10;
vector<int> G[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, d;
  cin >> n >> k >> d;
  set<int> S;
  pair<int, int> E[n];
  for (int i = 0; i < k; i++) {
    int p;
    cin >> p;
    S.insert(p);
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
    E[i] = {u, v};
  }
  queue<int> Q;
  int V[n + 1];
  memset(V, 0, sizeof(V));
  for (auto u : S) {
    Q.push(u);
    V[u] = u;
  }
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    for (int v : G[u]) {
      if (!V[v]) {
        V[v] = V[u];
        Q.push(v);
      }
    }
  }
  vector<int> A;
  for (int i = 0; i < n - 1; i++) {
    int a = E[i].first;
    int b = E[i].second;
    if (V[a] != V[b]) {
      A.push_back(i + 1);
    }
  }
  if (A.size() != S.size() - 1) {
    cout << "Sad:(\n";
  }
  cout << A.size() << "\n";
  for (auto u : A) {
    cout << u << " ";
  }
  return 0;
}
