#include <bits/stdc++.h>
using namespace std;
int n, k, u, v, d, x, dis[300001], vis[300001];
map<pair<int, int>, int> mp;
vector<int> G[300001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> d;
  memset(dis, -1, sizeof(dis));
  queue<int> q;
  for (int i = 1; i <= k; ++i) {
    cin >> x;
    dis[x] = 0;
    q.push(x);
  }
  for (int i = 1; i < n; ++i) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
    mp[{u, v}] = mp[{v, u}] = i;
  }
  while (!q.empty()) {
    int temp = q.front();
    q.pop();
    for (int j : G[temp]) {
      if (dis[j] == -1) {
        dis[j] = dis[temp] + 1;
        vis[mp[{j, temp}]] = 1;
        q.push(j);
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i < n; ++i)
    if (!vis[i]) ++cnt;
  cout << cnt << '\n';
  for (int i = 1; i < n; ++i)
    if (!vis[i]) cout << i << ' ';
}
