#include <stdio.h>
#include <queue>
#include <vector>
using namespace std;
queue<pair<int, int>> q;
vector<pair<int, int>> way[300005];
int v[300005];
int res[300005];
int main(){
int n, k, d;
scanf("%d%d%d", &n, &k, &d);
for(int i=0; i<k; i++){
int p;
scanf("%d", &p);
q.push({p, 0});
}
for(int i=0; i<n-1; i++){
int u, v;
scanf("%d%d", &u, &v);
way[u].push_back({v, i+1});
way[v].push_back({u, i+1});
}
while(!q.empty()){
int pos = q.front().first;
int from = q.front().second;
q.pop();
if(v[pos]) continue;
v[pos] = 1;
for(int i=0; i<way[pos].size(); i++) if(way[pos][i].first != from){
if(v[way[pos][i].first]) res[way[pos][i].second] = 1;
else q.push({way[pos][i].first, pos});
}
}
int rescnt=0;
for(int i=1; i<=n-1; i++) if(res[i]) rescnt++;
printf("%d\n", rescnt);
for(int i=1; i<=n-1; i++) if(res[i]) printf("%d ", i);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHZlY3Rvcj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnF1ZXVlPHBhaXI8aW50LCBpbnQ+PiBxOwp2ZWN0b3I8cGFpcjxpbnQsIGludD4+IHdheVszMDAwMDVdOwppbnQgdlszMDAwMDVdOwppbnQgcmVzWzMwMDAwNV07CgppbnQgbWFpbigpewogICAgaW50IG4sIGssIGQ7CiAgICBzY2FuZigiJWQlZCVkIiwgJm4sICZrLCAmZCk7CiAgICBmb3IoaW50IGk9MDsgaTxrOyBpKyspewogICAgICAgIGludCBwOwogICAgICAgIHNjYW5mKCIlZCIsICZwKTsKICAgICAgICBxLnB1c2goe3AsIDB9KTsKICAgIH0KICAgIGZvcihpbnQgaT0wOyBpPG4tMTsgaSsrKXsKICAgICAgICBpbnQgdSwgdjsKICAgICAgICBzY2FuZigiJWQlZCIsICZ1LCAmdik7CiAgICAgICAgd2F5W3VdLnB1c2hfYmFjayh7diwgaSsxfSk7CiAgICAgICAgd2F5W3ZdLnB1c2hfYmFjayh7dSwgaSsxfSk7CiAgICB9CiAgICB3aGlsZSghcS5lbXB0eSgpKXsKICAgICAgICBpbnQgcG9zID0gcS5mcm9udCgpLmZpcnN0OwogICAgICAgIGludCBmcm9tID0gcS5mcm9udCgpLnNlY29uZDsKICAgICAgICBxLnBvcCgpOwogICAgICAgIGlmKHZbcG9zXSkgY29udGludWU7CiAgICAgICAgdltwb3NdID0gMTsKICAgICAgICBmb3IoaW50IGk9MDsgaTx3YXlbcG9zXS5zaXplKCk7IGkrKykgaWYod2F5W3Bvc11baV0uZmlyc3QgIT0gZnJvbSl7CiAgICAgICAgICAgIGlmKHZbd2F5W3Bvc11baV0uZmlyc3RdKSByZXNbd2F5W3Bvc11baV0uc2Vjb25kXSA9IDE7CiAgICAgICAgICAgIGVsc2UgcS5wdXNoKHt3YXlbcG9zXVtpXS5maXJzdCwgcG9zfSk7CiAgICAgICAgfQogICAgfQogICAgaW50IHJlc2NudD0wOwogICAgZm9yKGludCBpPTE7IGk8PW4tMTsgaSsrKSBpZihyZXNbaV0pIHJlc2NudCsrOwogICAgcHJpbnRmKCIlZFxuIiwgcmVzY250KTsKICAgIGZvcihpbnQgaT0xOyBpPD1uLTE7IGkrKykgaWYocmVzW2ldKSBwcmludGYoIiVkICIsIGkpOwogICAgcmV0dXJuIDA7Cn0=