#include <bits/stdc++.h>
using namespace std;
const int maxn = 300300;
int dist[maxn], dad[maxn];
int d;
queue<int> visited;
vector<int> g[maxn];
map<pair<int, int>, int> input;
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k >> d;
  memset(dist, -1, sizeof dist);
  memset(dad, -1, sizeof dad);
  while (k--) {
    int point;
    cin >> point;
    point--;
    dist[point] = 0;
  }
  for (int e = 0; e < n - 1; e++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    if (x > y) swap(x, y);
    input[make_pair(x, y)] = e + 1;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int e = 0; e < n; e++)
    if (dist[e] == 0) visited.push(e);
  vector<int> ans;
  set<int> haha;
  while (!visited.empty()) {
    int cur = visited.front();
    visited.pop();
    for (auto &it : g[cur]) {
      if (dist[it] == -1 && dist[cur] != d) {
        dist[it] = dist[cur] + 1;
        dad[it] = cur;
        visited.push(it);
      } else {
        if (it != dad[cur]) {
          int a = it, b = cur;
          if (a > b) swap(a, b);
          haha.insert(input[make_pair(a, b)]);
        }
      }
    }
  }
  for (auto it : haha) ans.push_back(it);
  cout << ans.size() << endl;
  for (int e = 0; e < ans.size(); e++) cout << ans[e] << " ";
  cout << endl;
  return 0;
}
