#include <bits/stdc++.h>
using namespace std;
int in[300005];
int res[300005];
vector<pair<int, int> > v[300005];
queue<pair<int, int> > Q;
int dist[300005], vis[300005], d;
set<int> my;
void bfs() {
  while (!Q.empty()) {
    pair<int, int> cur = Q.front();
    int len = cur.second, node = cur.first;
    Q.pop();
    for (auto u : v[node])
      if (!vis[u.first] && len < d) {
        Q.push({u.first, len + 1});
        vis[u.first] = 1;
        res[u.second] = 1;
      }
  }
}
int main() {
  int n, k;
  cin >> n >> k >> d;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &in[i]);
    vis[in[i]] = 1;
    Q.push({in[i], 0});
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    v[x].push_back({y, i});
    v[y].push_back({x, i});
  }
  bfs();
  for (int i = 0; i < n - 1; i++)
    if (!res[i]) my.insert(i);
  cout << my.size() << endl;
  set<int>::iterator it;
  for (it = my.begin(); it != my.end(); it++) cout << *it + 1 << " ";
  return 0;
}
