#include <bits/stdc++.h>
using namespace std;
int n, k, d;
const int MAXN = 300005;
bool vis[MAXN];
vector<pair<int, int> > adj[MAXN];
queue<int> curr;
set<int> ans;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k >> d;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    vis[x] = true;
    curr.push(x);
  }
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(make_pair(y, i));
    adj[y].push_back(make_pair(x, i));
    ans.insert(i);
  }
  while (!curr.empty()) {
    int x = curr.front();
    curr.pop();
    for (int i = 0; i < adj[x].size(); i++) {
      int c = adj[x][i].first;
      if (!vis[c]) {
        curr.push(c);
        vis[c] = true;
        ans.erase(adj[x][i].second);
      }
    }
  }
  cout << ans.size() << "\n";
  for (set<int>::iterator it = ans.begin(); it != ans.end(); it++)
    cout << *it << " ";
  cout << "\n";
  return 0;
}
