#include <bits/stdc++.h>
using namespace std;
void input() {}
void solve() {
  long long int n, k, d;
  cin >> n >> k >> d;
  vector<pair<long long int, long long int>> adj[n + 1];
  queue<pair<long long int, long long int>> q;
  bool path[n], vis[n + 1];
  memset(path, false, sizeof(path));
  memset(vis, false, sizeof(vis));
  for (long long int i = 0; i < k; i++) {
    long long int x;
    cin >> x;
    q.push(make_pair(x, 0));
    vis[x] = true;
  }
  for (long long int i = 0; i < n - 1; i++) {
    long long int x, y;
    cin >> x >> y;
    adj[x].push_back(make_pair(y, i + 1));
    adj[y].push_back(make_pair(x, i + 1));
  }
  while (!q.empty()) {
    long long int pos = q.front().first, num = q.front().second;
    q.pop();
    for (auto x : adj[pos]) {
      if (!vis[x.first]) {
        path[x.second] = true;
        vis[x.first] = true;
        q.push(make_pair(x.first, x.second));
      }
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i < n; i++) {
    if (!path[i]) {
      cnt++;
    }
  }
  cout << cnt << "\n";
  for (long long int i = 1; i < n; i++) {
    if (!path[i]) {
      cout << i << " ";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  input();
  int t = 1, i = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
}
