#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
int n, k, d;
bool visited[maxn];
int par[maxn];
map<pair<int, int>, int> edge;
map<pair<int, int>, bool> mark;
vector<int> G[maxn];
vector<int> ans;
queue<int> Q;
void bfs() {
  while (!Q.empty()) {
    int v = Q.front();
    Q.pop();
    for (int u : G[v]) {
      if (!visited[u]) {
        par[u] = v;
        visited[u] = true;
        Q.push(u);
      } else if (u != par[v]) {
        if (!mark[{v, u}]) {
          mark[{v, u}] = mark[{u, v}] = true;
          ans.push_back(edge[{v, u}]);
        }
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> k >> d;
  for (int i = 0; i < k; i++) {
    int p;
    cin >> p;
    p--;
    if (!visited[p]) {
      Q.push(p);
      par[p] = -1;
    }
    visited[p] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    G[u].push_back(v);
    G[v].push_back(u);
    edge[{u, v}] = edge[{v, u}] = i + 1;
  }
  bfs();
  cout << ans.size() << '\n';
  for (int u : ans) {
    cout << u << ' ';
  }
}
