#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int n, k, d, p[N], dis[N];
vector<int> adj[N], ind[N], ans;
queue<int> que;
void bfs() {
  while (!que.empty()) {
    int v = que.front();
    que.pop();
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (dis[u] == -1) {
        dis[u] = dis[v] + 1;
        que.push(u);
      } else
        ans.push_back(ind[v][i]);
    }
  }
  return;
}
int main() {
  cin >> n >> k >> d;
  for (int i = 0; i < k; i++) {
    cin >> p[i];
    p[i]--;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
    ind[u].push_back(i);
    ind[v].push_back(i);
  }
  fill(dis, dis + N, -1);
  for (int i = 0; i < k; i++) {
    if (dis[p[i]] == -1) {
      que.push(p[i]);
      dis[p[i]] = 0;
    }
  }
  bfs();
  sort(ans.begin(), ans.end());
  vector<int> sol;
  for (int i = 1; i < ans.size(); i++) {
    if (ans[i - 1] == ans[i]) sol.push_back(ans[i]);
  }
  cout << sol.size() << '\n';
  for (int i = 0; i < sol.size(); i++) cout << sol[i] + 1 << " ";
  cout << '\n';
  return 0;
}
