#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << '{';
  for (int i = (0), __i = (((int)(vec).size())); i < __i; i++) {
    os << vec[i];
    if (i + 1 != ((int)(vec).size())) os << ',';
  }
  os << '}';
  return os;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &par) {
  os << '(' << par.first << ',' << par.second << ')';
  return os;
}
int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
template <class T>
T sqr(T x) {
  return x * x;
}
bool pairCompare(const std::pair<int, int> &firstElem,
                 const std::pair<double, int> &secondElem) {
  if (firstElem.first > secondElem.first)
    return true;
  else if (firstElem.first == secondElem.first &&
           firstElem.second < secondElem.second)
    return true;
  else
    return false;
}
vector<long long> a;
vector<vector<int> > w;
int main() {
  ios::sync_with_stdio(false);
  FILE *f;
  int n, d, k;
  cin >> n >> k >> d;
  queue<int> v;
  vector<bool> visited;
  vector<int> from;
  vector<vector<pair<int, int> > > w;
  visited.resize(n, false);
  w.resize(n);
  from.resize(n, -1);
  set<int> s;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    if (s.find(x - 1) == s.end()) {
      v.push(x - 1);
      visited[x - 1] = true;
      s.insert(x - 1);
    }
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    w[a].push_back(make_pair(b, i + 1));
    w[b].push_back(make_pair(a, i + 1));
  }
  vector<int> ans;
  vector<bool> deletedE(n - 1, false);
  while (!v.empty()) {
    int cur = v.front();
    visited[cur] = true;
    for (int i = 0; i < w[cur].size(); i++)
      if (!visited[w[cur][i].first]) {
        v.push(w[cur][i].first);
        visited[w[cur][i].first] = true;
        from[w[cur][i].first] = cur;
      } else if (from[cur] != w[cur][i].first &&
                 !deletedE[w[cur][i].second - 1]) {
        ans.push_back(w[cur][i].second);
        deletedE[w[cur][i].second - 1] = true;
      }
    v.pop();
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
