#include <bits/stdc++.h>
using namespace std;
const int maxn = 300050;
const int inf = 1 << 30;
const long long INF = 1ll << 61;
const double eps = 1e-9;
int n, m, d, h, dis[maxn];
int u[maxn], v[maxn];
bool vis[maxn], us[maxn];
vector<pair<int, int> > nex[maxn];
queue<int> q;
vector<int> ans;
int main() {
  scanf("%d%d%d", &n, &m, &d);
  memset(dis, 0x3f, sizeof(dis));
  for (int i = 1; i <= m; ++i) {
    int x;
    scanf("%d", &x);
    dis[x] = 0;
    q.push(x);
  }
  for (int i = 1; i <= n - 1; ++i) {
    scanf("%d%d", &u[i], &v[i]);
    nex[u[i]].push_back(make_pair(v[i], i));
    nex[v[i]].push_back(make_pair(u[i], i));
  }
  while (!q.empty()) {
    h = q.front();
    q.pop();
    for (auto p : nex[h])
      if (dis[p.first] == 0x3f3f3f3f) {
        dis[p.first] = dis[h] + 1;
        us[p.second] = true;
        q.push(p.first);
      }
  }
  for (int i = 1; i <= n - 1; ++i)
    if (!us[i]) ans.push_back(i);
  printf("%d\n", ans.size());
  for (auto p : ans) printf("%d ", p);
  return 0;
}
