#include <bits/stdc++.h>
using namespace std;
struct node {
  int to, val, id;
};
vector<node> g[300100];
vector<int> ans;
queue<int> q;
bool vis[300100], way[300100];
void bfs() {
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    int sz = g[u].size();
    for (int i = 0; i < sz; i++) {
      int v = g[u][i].to;
      if (!vis[v]) {
        vis[v] = 1;
        way[g[u][i].id] = 1;
        q.push(v);
      }
    }
  }
}
int main() {
  int n, k, d;
  while (~scanf("%d%d%d", &n, &k, &d)) {
    for (int i = 1; i <= n; i++) {
      g[i].clear();
      way[i] = vis[i] = 0;
    }
    ans.clear();
    for (int i = 0; i < k; i++) {
      int x;
      scanf("%d", &x);
      q.push(x);
      vis[x] = 1;
    }
    for (int i = 1; i <= n - 1; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      g[u].push_back({v, 1, i});
      g[v].push_back({u, 1, i});
    }
    bfs();
    for (int i = 1; i <= n - 1; i++) {
      if (!way[i]) ans.push_back(i);
    }
    int sz = ans.size();
    printf("%d\n", sz);
    for (int i = 0; i < sz; i++) {
      if (i == 0)
        printf("%d", ans[i]);
      else
        printf(" %d", ans[i]);
    }
    puts("");
  }
  return 0;
}
