#include <bits/stdc++.h>
using namespace std;
vector<int> G[300005];
map<pair<int, int>, int> f;
int n, k, d, u, v, ans, p[300005], Ans[2 * 300005], q[300005], fa[300005];
bool vis[300005];
int main() {
  scanf("%d%d%d", &n, &k, &d);
  int s = 1, t = 1;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &p[i]);
    if (!vis[p[i]]) {
      vis[p[i]] = 1;
      q[t++] = p[i];
    }
  }
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
    if (u > v) swap(u, v);
    f[make_pair(u, v)] = i;
  }
  while (s != t) {
    int u = q[s++];
    for (int v : G[u])
      if (!vis[v]) {
        fa[v] = u;
        vis[v] = 1;
        q[t++] = v;
      } else if (fa[u] != v)
        Ans[++ans] = f[make_pair(min(u, v), max(u, v))];
  }
  sort(Ans + 1, Ans + 1 + ans);
  ans = unique(Ans + 1, Ans + 1 + ans) - Ans - 1;
  cout << ans << endl;
  for (int i = 1; i <= ans; i++) cout << Ans[i] << " ";
}
