#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 5e5 + 10;
vector<pair<int, int>> v[N];
int vis[N], vv[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, d;
  cin >> n >> m >> d;
  queue<int> qu;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    vis[a] = 1;
    qu.push(a);
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back({b, i + 1});
    v[b].push_back({a, i + 1});
  }
  set<int> ans;
  while (!qu.empty()) {
    int x = qu.front();
    qu.pop();
    for (auto it : v[x]) {
      if (vv[it.second]) continue;
      vv[it.second] = 1;
      if (vis[it.first]) {
        ans.insert(it.second);
        continue;
      }
      vis[it.first] = 1;
      qu.push(it.first);
    }
  }
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it << " ";
  return 0;
}
