#include <bits/stdc++.h>
using namespace std;
long long po(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2) {
      x = x * y;
      x %= 1000000007;
    }
    y = y * y;
    y %= 1000000007;
    b /= 2;
  }
  return x;
}
static vector<int> adj[500005];
int main() {
  if (0) {
    freopen("C:/Users/gold/Desktop/sublime IO/input.txt", "r", stdin);
    freopen("C:/Users/gold/Desktop/sublime IO/output.txt", "w", stdout);
  }
  int T = 1;
  while (T--) {
    int n, k, d;
    scanf("%d %d %d", &n, &k, &d);
    static bool v[500005];
    queue<pair<int, pair<int, int> > > q;
    for (int i = 0; i < k; i++) {
      int x;
      scanf("%d", &x);
      q.push(make_pair(x, make_pair(0, -1)));
      v[x] = true;
    }
    vector<pair<int, int> > e;
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      scanf("%d %d", &u, &v);
      adj[u].push_back(v);
      adj[v].push_back(u);
      e.push_back(make_pair(u, v));
    }
    map<pair<int, int>, bool> dp;
    while (!q.empty()) {
      pair<int, pair<int, int> > tmp = q.front();
      q.pop();
      dp[make_pair(tmp.first, tmp.second.second)] =
          dp[make_pair(tmp.second.second, tmp.first)] = true;
      if (tmp.second.first == d) {
        continue;
      }
      int cur = tmp.first;
      for (int i = 0; i < adj[cur].size(); i++) {
        if (v[adj[cur][i]] == 0) {
          q.push(make_pair(adj[cur][i], make_pair(tmp.second.first + 1, cur)));
          v[adj[cur][i]] = true;
        }
      }
    }
    vector<int> ans;
    for (int i = 0; i < e.size(); i++) {
      if (dp[e[i]]) {
        continue;
      } else
        ans.push_back(i + 1);
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i]);
    }
    puts("");
  }
  return 0;
}
