#include <bits/stdc++.h>
using namespace std;
struct G {
  int n, m;
  int Next[650003];
  int head[300003];
  int ver[650003];
  int tot;
  void clear(int x) {
    tot = 0;
    memset(head, 0, (x + 3) * sizeof(int));
  }
  void add(int x, int y) { ver[++tot] = y, Next[tot] = head[x], head[x] = tot; }
} g;
int k, d;
int pc[300003];
struct edge {
  int x;
  int y;
} eg[650003];
int vis[300003];
void bfs() {
  queue<pair<int, int>> q;
  int in = 1;
  set<int> s;
  for (int i = (1); i < k + 1; i++) {
    if (s.count(pc[i])) continue;
    s.insert(pc[i]);
    q.push({pc[i], in});
    vis[pc[i]] = in++;
  }
  while (!q.empty()) {
    int x = q.front().first;
    int c = q.front().second;
    q.pop();
    for (int i = g.head[x]; i; i = g.Next[i]) {
      int y = g.ver[i];
      if (vis[y]) continue;
      vis[y] = c;
      q.push({y, c});
    }
  }
}
int main() {
  scanf("%d%d%d", &g.n, &k, &d);
  for (int i = (1); i < k + 1; i++) scanf("%d", &pc[i]);
  g.m = g.n - 1;
  for (int i = (1); i < g.m + 1; i++) {
    scanf("%d%d", &eg[i].x, &eg[i].y);
    g.add(eg[i].x, eg[i].y);
    g.add(eg[i].y, eg[i].x);
  }
  bfs();
  vector<int> ans;
  for (int i = (1); i < g.m + 1; i++) {
    if (vis[eg[i].x] != vis[eg[i].y]) ans.push_back(i);
  }
  printf("%d\n", ans.size());
  for (auto p : ans) printf("%d ", p);
  return 0;
}
