#include <bits/stdc++.h>
using namespace std;
int n, k, d, x, y, dis[300005], vis[300005], us[300005];
queue<pair<int, int> > q;
vector<pair<int, int> > E[300005];
vector<int> v;
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 1; i <= n; i++) dis[i] = 1000000007;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x);
    q.push({x, 0});
    dis[x] = 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d%d", &x, &y);
    E[x].push_back({y, i});
    E[y].push_back({x, i});
  }
  while (!q.empty()) {
    x = q.front().first;
    y = q.front().second;
    q.pop();
    if (vis[x] == 1) continue;
    vis[x] = 1, us[y] = 1;
    for (auto i : E[x]) {
      if (dis[i.first] > dis[x] + 1) {
        dis[i.first] = dis[x] + 1;
        q.push({i.first, i.second});
      }
    }
  }
  for (int i = 1; i <= n - 1; i++)
    if (!us[i]) v.push_back(i);
  printf("%d\n", int(v.size()));
  for (auto i : v) {
    printf("%d ", i);
  }
}
