#include <bits/stdc++.h>
using namespace std;
map<int, map<int, int> > id;
vector<int> p, g[300005];
int vis[300005], flag[300005], pre[300005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k, d;
  cin >> n >> k >> d;
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    if (flag[x] == 0) {
      p.push_back(x);
      flag[x] = 1;
    }
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    id[x][y] = id[y][x] = i;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  set<int> ans;
  queue<int> q;
  for (int i = 0; i < p.size(); i++) {
    q.push(p[i]);
    vis[p[i]] = 1;
  }
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int j = 0; j < g[x].size(); j++) {
      int t = g[x][j];
      if (vis[t] != 0 && pre[x] != t) {
        ans.insert(id[x][t]);
        continue;
      }
      if (vis[t]) continue;
      pre[t] = x;
      vis[t] = 1;
      q.push(t);
    }
  }
  cout << ans.size() << '\n';
  set<int>::iterator it;
  for (it = ans.begin(); it != ans.end(); it++) {
    cout << *it;
    if (it == --ans.end())
      cout << '\n';
    else
      cout << ' ';
  }
  return 0;
}
