#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e6 + 42 + 17;
int n, a[MAXN], pc, d, par[MAXN];
vector<int> adj[MAXN];
vector<pair<int, int> > P;
int dist[MAXN];
pair<int, int> e[MAXN];
void mainp() {
  cin >> n >> pc >> d;
  for (int i = 0; i < pc; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[v].push_back(u);
    adj[u].push_back(v);
    e[i + 1] = {u, v};
  }
  memset(dist, -1, sizeof(dist));
  queue<int> q;
  for (int i = 0; i < pc; i++) {
    q.push(a[i]);
    par[a[i]] = -1;
    dist[a[i]] = 0;
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < adj[u].size(); i++) {
      int v = adj[u][i];
      if (dist[v] == -1) {
        dist[v] = dist[u] + 1;
        par[v] = u;
        q.push(v);
      }
    }
  }
  map<pair<int, int>, bool> has;
  for (int i = 1; i <= n; i++)
    if (par[i] != -1) {
      has[{i, par[i]}] = 1;
      has[{par[i], i}] = 1;
    }
  vector<int> ans;
  for (int i = 1; i < n; i++)
    if (!has.count(e[i])) ans.push_back(i);
  cout << ans.size() << '\n';
  for (int x : ans) cout << x << " ";
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  mainp();
  return 0;
}
