#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
int A[maxn], dis[maxn];
bool vis[maxn];
vector<int> lad[maxn];
int main() {
  int k, u, v, n, t;
  memset(dis, -1, sizeof(dis));
  memset(vis, 0, sizeof(vis));
  cin >> n >> k >> t;
  for (int i = 0; i < k; ++i) cin >> A[i];
  sort(A, A + k);
  k = unique(A, A + k) - A;
  map<pair<int, int>, int> mp;
  vector<int> ans;
  for (int i = 0; i < n - 1; ++i) {
    cin >> u >> v;
    --u, --v;
    lad[u].push_back(v);
    lad[v].push_back(u);
    mp[{u, v}] = i + 1;
    mp[{v, u}] = i + 1;
  }
  queue<int> Q;
  for (int i = 0; i < k; ++i) {
    A[i]--;
    Q.push(A[i]);
    dis[A[i]] = 0;
  }
  while (not Q.empty()) {
    int x = Q.front();
    Q.pop();
    vis[x] = 1;
    for (int y : lad[x]) {
      if (vis[y]) continue;
      if (dis[y] == -1) {
        dis[y] = dis[x] + 1;
        Q.push(y);
      } else if (mp.count({x, y}))
        ans.push_back(mp[{x, y}]);
    }
  }
  cout << ans.size() << endl;
  for (int id : ans) cout << id << ' ';
  return 0;
}
