#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5 + 5;
bool visited[MAX];
int dist[MAX];
vector<pair<int, int> > adjList[MAX];
queue<pair<int, int> > q;
set<int> printed;
int main() {
  int n, k, d;
  scanf("%d %d %d", &n, &k, &d);
  int v1, v2;
  memset(dist, -1, sizeof(dist));
  for (int i = 0; i < k; i++) {
    scanf("%d", &v1);
    q.push(make_pair(v1, 0));
  }
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &v1, &v2);
    adjList[v1].push_back(make_pair(v2, i));
    adjList[v2].push_back(make_pair(v1, i));
  }
  while (!q.empty()) {
    pair<int, int> u = q.front();
    q.pop();
    if (visited[u.first]) continue;
    visited[u.first] = 1;
    for (int i = 0; i < adjList[u.first].size(); i++) {
      pair<int, int> t = adjList[u.first][i];
      if (t.first != u.second) {
        if (visited[t.first])
          printed.insert(t.second);
        else {
          q.push(make_pair(t.first, u.first));
        }
      }
    }
  }
  printf("%lu\n", printed.size());
  for (auto it = printed.begin(); it != printed.end(); it++) {
    if (it != printed.begin()) putchar(' ');
    printf("%d", *it);
  }
  if (printed.size() > 0) putchar('\n');
  return 0;
}
