#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
constexpr int INF = 0x3f3f3f3f;
constexpr ll LLINF = 0x3f3f3f3f3f3f3f3f;
template <class RIt>
void dbarr(RIt frs, RIt lst) {
  cerr << "arr: ";
  for (int i = 0; i < (int)(lst - frs); i++)
    cerr << frs[i] << " \n"[i == (int)(lst - frs) - 1];
}
const int MM = 3e5 + 5;
int n, k, d;
bool pol[MM], vis[MM];
vector<pi> adj[MM];
int main() {
  cin.exceptions(cin.failbit);
  cin.tie(0)->sync_with_stdio(0);
  cin >> n >> k >> d;
  queue<pi> q;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    pol[x] = 1;
    q.push({x, 0});
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].emplace_back(b, i);
    adj[b].emplace_back(a, i);
  }
  set<int> res;
  while (q.size()) {
    auto [u, p] = q.front();
    q.pop();
    if (vis[u]) continue;
    vis[u] = 1;
    for (auto [v, i] : adj[u]) {
      if (v == p) continue;
      if (vis[v])
        res.insert(i);
      else
        q.push({v, u});
    }
  }
  cout << res.size() << "\n";
  for (int x : res) cout << x + 1 << " ";
  cout << "\n";
}
