#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
vector<int> G[300050];
queue<pair<int, int>> q;
int vis[300050], color, ans[300050], anscnt, u[300050], v[300050];
int main() {
  int n = read(), k = read(), d = read();
  for (int i = 1; i <= k; i++) {
    int p = read();
    if (!vis[p]) {
      q.push({p, ++color});
      vis[p] = color;
    }
  }
  for (int i = 1; i < n; i++) {
    u[i] = read(), v[i] = read();
    G[u[i]].push_back(v[i]);
    G[v[i]].push_back(u[i]);
  }
  while (!q.empty()) {
    auto u = q.front();
    q.pop();
    for (int i = 0; i < G[u.first].size(); i++) {
      int v = G[u.first][i];
      if (!vis[v]) {
        vis[v] = u.second;
        q.push({v, vis[v]});
      }
    }
  }
  for (int i = 1; i < n; i++) {
    if (vis[u[i]] != vis[v[i]]) ans[++anscnt] = i;
  }
  cout << anscnt << endl;
  for (int i = 1; i <= anscnt; i++) cout << ans[i] << " ";
  return 0;
}
