#include <bits/stdc++.h>
using namespace std;
const int N = 300007;
int p[N];
bool visited[N];
bool roads[N];
vector<int> ans;
int n, k, d;
vector<pair<int, int> > v[N];
queue<int> Q;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(visited, 0, sizeof(visited));
  memset(roads, 0, sizeof(roads));
  cin >> n >> k >> d;
  int use, c1, c2;
  for (int i = 1; i <= k; i++) {
    cin >> use;
    visited[use] = 1;
    p[use] = use;
    Q.push(use);
  }
  for (int i = 1; i <= n - 1; i++) {
    cin >> c1 >> c2;
    v[c1].push_back({c2, i});
    v[c2].push_back({c1, i});
  }
  while (!Q.empty()) {
    int c = Q.front();
    Q.pop();
    for (int i = 0; i < v[c].size(); i++) {
      if (!visited[v[c][i].first]) {
        visited[v[c][i].first] = 1;
        p[v[c][i].first] = p[c];
        Q.push(v[c][i].first);
      } else if (p[v[c][i].first] != p[c] && !roads[v[c][i].second]) {
        roads[v[c][i].second] = 1;
        ans.push_back(v[c][i].second);
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
