#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
int n, k, d, a, b, book[maxn], vis[maxn];
vector<int> edge[maxn];
vector<int> BH[maxn];
queue<int> q;
vector<int> ans;
int main() {
  memset(book, 0, sizeof(book));
  memset(vis, 0, sizeof(vis));
  cin >> n >> k >> d;
  for (int i = 1; i <= k; i++) {
    cin >> a;
    book[a] = 1;
  }
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
    BH[a].push_back(i);
    BH[b].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (book[i]) {
      q.push(i);
    }
  }
  int cnt = 0;
  while (!q.empty()) {
    int p = q.front();
    q.pop();
    for (int i = 0; i < edge[p].size(); i++) {
      int y = edge[p][i];
      int x = BH[p][i];
      if (!book[y]) {
        book[y] = 1;
        vis[x] = 1;
        q.push(y);
      } else if (!vis[x]) {
        ans.push_back(x);
      }
    }
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    i == ans.size() - 1 ? cout << ans[i] << "\n" : cout << ans[i] << " ";
  }
  return 0;
}
