#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > a[3 * int(1e5) + 5];
queue<pair<int, int> > q;
int n, k, d;
bool tv[3 * int(1e5) + 5], rs[3 * int(1e5) + 5];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> k >> d;
  int u, v;
  for (int i = 1; i <= k; i++) {
    cin >> u;
    q.push(pair<int, int>(u, 0));
  }
  for (int i = 1; i <= n - 1; i++) {
    cin >> u >> v;
    a[u].push_back(pair<int, int>(v, i));
    a[v].push_back(pair<int, int>(u, i));
  }
  while (q.size() != 0) {
    u = q.front().first;
    v = q.front().second;
    q.pop();
    if (tv[u]) continue;
    tv[u] = true;
    for (int i = 0; i <= a[u].size() - 1; i++)
      if (a[u][i].first != v)
        if (tv[a[u][i].first])
          rs[a[u][i].second] = true;
        else
          q.push(pair<int, int>(a[u][i].first, u));
  }
  int d = 0;
  for (int i = 1; i <= n - 1; i++)
    if (rs[i]) d++;
  cout << d << ' ';
  for (int i = 1; i <= n - 1; i++)
    if (rs[i]) cout << i << ' ';
}
