#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
vector<pair<int, int>> adj[N];
queue<pair<int, int>> q;
bool vis[N], res[N];
int main() {
  ios_base::sync_with_stdio(0);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, k, d;
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 0; i < k; ++i) {
    int x;
    scanf("%d", &x);
    q.push({x, 0});
  }
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back({v, i + 1});
    adj[v].push_back({u, i + 1});
  }
  while (!q.empty()) {
    int CurrentNode = q.front().first;
    int From = q.front().second;
    q.pop();
    if (vis[CurrentNode]) continue;
    vis[CurrentNode] = true;
    for (int i = 0; i < adj[CurrentNode].size(); ++i) {
      if (adj[CurrentNode][i].first != From) {
        if (vis[adj[CurrentNode][i].first])
          res[adj[CurrentNode][i].second] = 1;
        else
          q.push({adj[CurrentNode][i].first, CurrentNode});
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n - 1; ++i)
    if (res[i]) ++ans;
  printf("%d\n", ans);
  for (int i = 1; i <= n - 1; ++i)
    if (res[i]) printf("%d ", i);
  return 0;
}
