#include <bits/stdc++.h>
using namespace std;
int N, K, D;
vector<int> edge[310000];
int parent[310000];
map<pair<int, int>, int> mp;
int station[310000];
queue<int> q;
set<int> ans;
int32_t main() {
  ios_base::sync_with_stdio(false);
  if (fopen("cf796d.in", "r")) {
    freopen("cf796d.in", "r", stdin);
    freopen("cf796d.out", "w", stdout);
  }
  cin >> N >> K >> D;
  for (int i = 0; i < K; i++) {
    cin >> station[i];
    station[i]--;
  }
  for (int i = 1; i < N; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    edge[a].push_back(b);
    edge[b].push_back(a);
    mp[make_pair(a, b)] = i;
    mp[make_pair(b, a)] = i;
  }
  for (int i = 0; i < N; i++) {
    parent[i] = -1;
  }
  for (int i = 0; i < K; i++) {
    q.push(station[i]);
    parent[station[i]] = -2;
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < edge[u].size(); i++) {
      int v = edge[u][i];
      if (parent[v] == u || parent[u] == v) {
        continue;
      }
      if (parent[v] != -1) {
        ans.insert(mp[make_pair(u, v)]);
        continue;
      }
      parent[v] = u;
      q.push(v);
    }
  }
  cout << ans.size() << '\n';
  for (auto it = ans.begin(); it != ans.end(); it++) {
    cout << *it << ' ';
  }
  cout << '\n';
  return 0;
}
