#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 5;
const int K = (int)3e5 + 5;
vector<pair<int, int>> adj[N];
queue<pair<int, int>> q;
bool visited[N];
int res[300005];
int n;
int k;
int d;
int main() {
  scanf("%d%d%d", &n, &k, &d);
  for (int i = 0; i < k; i++) {
    int place;
    scanf("%d", &place);
    q.push({place, 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 pos = q.front().first;
    int from = q.front().second;
    q.pop();
    if (visited[pos]) continue;
    visited[pos] = 1;
    for (pair<int, int> u : adj[pos]) {
      if (u.first != from) {
        if (visited[u.first])
          res[u.second] = 1;
        else
          q.push({u.first, pos});
      }
    }
  }
  int rescnt = 0;
  for (int i = 1; i <= n - 1; i++)
    if (res[i]) rescnt++;
  cout << rescnt << endl;
  for (int x = 1; x <= n - 1; x++)
    if (res[x]) cout << x << " ";
  return 0;
}
