#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  int zf = 1;
  char ch = ' ';
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') zf = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * zf;
}
struct Edge {
  int to, next;
} edges[600005];
int head[300005], edge_num = 0;
void addEdge(int from, int to) {
  edges[++edge_num] = (Edge){to, head[from]};
  head[from] = edge_num;
}
struct Node {
  int id;
  int clr;
};
queue<Node> que;
int vis[300005];
int ans[300005], ans_num = 0;
void BFS() {
  Node u;
  while (!que.empty()) {
    u = que.front(), que.pop();
    for (int c_e = head[u.id]; c_e; c_e = edges[c_e].next) {
      int v = edges[c_e].to;
      if (!vis[v]) {
        vis[v] = u.clr;
        que.push((Node){v, u.clr});
      }
    }
  }
}
int u[300005], v[300005];
int main() {
  int n = read(), k = read(), d = read();
  int clr = 0, kk = 0;
  for (int i = 1; i <= k; ++i) {
    int pol = read();
    if (!vis[pol]) {
      ++kk;
      que.push((Node){pol, ++clr});
      vis[pol] = clr;
    }
  }
  for (int i = 1; i < n; ++i) {
    u[i] = read(), v[i] = read();
    addEdge(u[i], v[i]), addEdge(v[i], u[i]);
  }
  BFS();
  for (int i = 1; i < n; ++i)
    if (vis[u[i]] != vis[v[i]]) ans[++ans_num] = i;
  printf("%d\n", ans_num);
  for (int i = 1; i <= ans_num; ++i) {
    if (i != 1) printf(" ");
    printf("%d", ans[i]);
  }
  return 0;
}
