#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, d;
  cin >> n >> k >> d;
  long long dis[n + 1], vis[n + 1];
  for (long long i = 1; i <= n; i++) dis[i] = 1e18, vis[i] = 0;
  queue<long long> bfs;
  set<long long> b;
  vector<pair<long long, long long> > e[n + 1];
  for (long long i = 0; i < k; i++) {
    long long u;
    cin >> u;
    b.insert(u);
    dis[u] = 0;
    vis[u] = u;
  }
  for (auto u : b) bfs.push(u);
  for (long long i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    e[u].push_back(make_pair(v, i));
    e[v].push_back(make_pair(u, i));
  }
  set<long long> ans;
  while (!bfs.empty()) {
    long long u = bfs.front();
    bfs.pop();
    for (auto v : e[u]) {
      if (vis[v.first] > 0 && vis[v.first] != vis[u])
        ans.insert(v.second + 1);
      else if (dis[u] < d && vis[v.first] == 0) {
        dis[v.first] = dis[u] + 1;
        vis[v.first] = vis[u];
        bfs.push(v.first);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i << " ";
  cout << endl;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  for (int i = 1; i <= q; i++) {
    solve();
  }
  return 0;
}
