#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 1, -1, 0, 1, -1, -1, 1};
const int dy[] = {-1, 0, 0, 1, 1, 1, -1, -1};
const long long int MOD = 0;
const long long int N = 0;
int p[300010];
int d[300010];
char vv[300010];
vector<int> g[300010];
vector<pair<int, pair<int, int> > > e;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, u, v, x, ad;
  cin >> n >> k >> ad;
  queue<pair<int, int> > q;
  memset(p, -1, sizeof p);
  memset(vv, 0, sizeof vv);
  for (int i = 0; i < n; i++) {
    d[i] = 1e9;
  }
  for (int i = 0; i < k; i++) {
    cin >> x;
    x--;
    q.push(make_pair(x, 0));
    p[x] = x;
    d[x] = 0;
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
    e.push_back(make_pair(i + 1, make_pair(u, v)));
  }
  int dd;
  while (!q.empty()) {
    u = q.front().first;
    dd = q.front().second;
    q.pop();
    if (vv[u]) continue;
    vv[u] = 1;
    for (int i = 0; i < g[u].size(); i++) {
      v = g[u][i];
      if (d[u] + 1 < d[v]) {
        d[v] = d[u] + 1;
        p[v] = p[u];
        q.push(make_pair(v, dd + 1));
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < e.size(); i++) {
    if (p[e[i].second.first] != p[e[i].second.second]) cnt++;
  }
  cout << cnt << "\n";
  for (int i = 0; i < e.size(); i++) {
    if (p[e[i].second.first] != p[e[i].second.second]) {
      cout << e[i].first << "\n";
    }
  }
  return 0;
}
