#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265359;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long N = 3e5 + 10;
const long long INF = 1e18;
long long n, v, u, k, d;
set<long long> st;
long long dis[N];
vector<pair<long long, long long> > g[N];
long long ans[N];
void BFS() {
  queue<long long> q;
  for (auto u : st) q.push(u);
  while (q.size()) {
    long long fr = q.front();
    q.pop();
    for (auto u : g[fr]) {
      if (dis[u.first] > dis[fr] + 1) {
        dis[u.first] = dis[fr] + 1;
        ans[u.second] = 1;
        q.push(u.first);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> d;
  memset(dis, 63, sizeof dis);
  for (int i = 0; i < k; i++) {
    cin >> v;
    st.insert(v);
    dis[v] = 0;
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> v >> u;
    g[v].push_back({u, i + 1}), g[u].push_back({v, i + 1});
  }
  BFS();
  long long Cnt = 0;
  vector<long long> ann;
  for (int i = 1; i <= n - 1; i++) {
    if (ans[i] == 0) {
      Cnt++;
      ann.push_back(i);
    }
  }
  cout << Cnt << '\n';
  for (auto u : ann) cout << u << ' ';
  return 0;
}
