#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
const long double E = 1e-5;
unsigned char ccc;
bool _minus = false;
template <typename T>
inline T sqr(T t) {
  return (t * t);
}
inline void read(long long &n) {
  n = 0;
  _minus = false;
  while (true) {
    ccc = getchar();
    if (ccc == ' ' || ccc == '\n') break;
    if (ccc == '-') {
      _minus = true;
      continue;
    }
    n = n * 10 + ccc - '0';
  }
  if (_minus) n *= -1;
}
inline void read(int &n) {
  n = 0;
  _minus = false;
  while (true) {
    ccc = getchar();
    if (ccc == ' ' || ccc == '\n') break;
    if (ccc == '-') {
      _minus = true;
      continue;
    }
    n = n * 10 + ccc - '0';
  }
  if (_minus) n *= -1;
}
char wwww[19];
int kkkk;
inline void write(long long y) {
  long long x = y;
  kkkk = 0;
  if (!x)
    ++kkkk, wwww[kkkk] = '0';
  else
    while (x) {
      ++kkkk;
      wwww[kkkk] = char(x % 10 + '0');
      x /= 10;
    }
  for (int i = kkkk; i >= 1; --i) putchar(wwww[i]);
  putchar(' ');
}
const int INF = 1e9;
const int MAX = 3e5 + 10;
vector<pair<int, int> > vec[MAX];
bool used[MAX];
vector<int> ans;
int d;
int dist[MAX];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  srand(time(NULL));
  cout.precision(3);
  cout << fixed;
  int n, k;
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) {
    dist[i] = INF;
  }
  queue<int> q;
  int pos;
  for (int i = 0; i < k; i++) {
    cin >> pos;
    dist[pos] = 0;
    q.push(pos);
  }
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    vec[a].push_back(make_pair(b, i));
    vec[b].push_back(make_pair(a, i));
  }
  while (!q.empty()) {
    int pos = q.front();
    q.pop();
    for (pair<int, int> a : vec[pos]) {
      if (dist[a.first] == INF) {
        dist[a.first] = dist[pos] + 1;
        q.push(a.first);
        used[a.second] = true;
      }
    }
  }
  for (int i = 1; i < n; i++) {
    if (!used[i]) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << "\n";
  for (int a : ans) {
    cout << a << " ";
  }
}
