#include <bits/stdc++.h>
using namespace std;
const int MAXN = 6e+5 + 50;
vector<pair<int, int> > g[MAXN];
int vis[MAXN];
int n, k, d;
queue<pair<int, int> > q;
int ans;
int mk[MAXN];
void bfs() {
  while (!q.empty()) {
    int pos = q.front().first, from = q.front().second;
    q.pop();
    if (vis[pos]) continue;
    vis[pos] = 1;
    for (int i = 0; i < g[pos].size(); i++) {
      int temp = g[pos][i].first, id = g[pos][i].second;
      if (temp != from) {
        if (vis[temp]) {
          mk[id] = 1;
          ans++;
        } else {
          q.push(make_pair(temp, pos));
        }
      }
    }
  }
}
int main(int argc, char *argv[]) {
  while (cin >> n >> k >> d) {
    for (int i = 0; i <= n; i++) {
      g[i].clear();
    }
    while (!q.empty()) {
      q.pop();
    }
    memset(vis, 0, sizeof(vis));
    memset(mk, 0, sizeof(mk));
    ans = 0;
    int pos;
    for (int i = 1; i <= k; i++) {
      scanf("%d", &pos);
      q.push(make_pair(pos, 0));
    }
    int from, to;
    for (int i = 1; i <= n - 1; i++) {
      scanf("%d%d", &from, &to);
      g[from].push_back(make_pair(to, i));
      g[to].push_back(make_pair(from, i));
    }
    bfs();
    cout << ans << endl;
    for (int i = 1; i <= n - 1; i++)
      if (mk[i]) cout << i << ' ';
    cout << endl;
  }
  return 0;
}
