#include <bits/stdc++.h>
using namespace std;
int vis[500005];
queue<int> q;
vector<int> g[500005];
map<pair<int, int>, int> mp;
int road[500005];
int main() {
  int n, k, d;
  cin >> n >> k >> d;
  memset(vis, 0, sizeof(vis));
  memset(road, 0, sizeof(road));
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    q.push(x);
    vis[x] = 1;
  }
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    mp[make_pair(x, y)] = i;
    mp[make_pair(y, x)] = i;
  }
  int ans = 0;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < g[v].size(); i++) {
      int u = g[v][i];
      if (!vis[u]) {
        q.push(u);
        ans++;
        road[mp[make_pair(v, u)]] = 1;
        vis[u] = 1;
      }
    }
  }
  cout << n - 1 - ans << endl;
  for (int i = 1; i <= n - 1; i++) {
    if (!road[i]) cout << i << " ";
  }
  return 0;
}
