#include <bits/stdc++.h>
using namespace std;
const int MAX_K = 3e5 + 5;
const int MAX_N = 3e5 + 5;
struct Road {
  int to, index;
} rd;
int n, k, d;
int p[MAX_K], vis[MAX_N];
vector<Road> G[MAX_N];
vector<int> ans;
void BFS() {
  queue<int> que;
  for (int i = 1; i <= k; i++) {
    if (vis[p[i]] != 0) continue;
    vis[p[i]] = p[i];
    que.push(p[i]);
  }
  int u, size;
  while (!que.empty()) {
    u = que.front();
    que.pop();
    size = G[u].size();
    for (int i = 0; i < size; i++) {
      rd = G[u][i];
      if (vis[rd.to] == 0) {
        vis[rd.to] = vis[u];
        que.push(rd.to);
      } else {
        if (vis[rd.to] != vis[u]) {
          ans.push_back(rd.index);
        }
      }
    }
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  int cnt = ans.size();
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%d%c", ans[i], i == cnt - 1 ? '\n' : ' ');
  }
}
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &p[i]);
  }
  int u, v;
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d%d", &u, &v);
    rd.to = v;
    rd.index = i;
    G[u].push_back(rd);
    rd.to = u;
    rd.index = i;
    G[v].push_back(rd);
  }
  BFS();
  return 0;
}
