Dima and the Famous Tourist
The renowned traveler Gennady always opts for the shortest routes during his journeys. Dima, an avid fan of Gennady, collects every piece of information he can find about him—be it newspaper clippings, online news, or more.
Recently, Gennady embarked on a journey. Along the way, some of his fans spotted him in various cities and documented their sightings in their blogs. Dima discovered all these accounts, but since he gathered this information after the journey had concluded, he couldn't determine the chronological order of the records. He only knows the set of cities that Gennady definitely visited. Dima is certain that Gennady traveled from one city to another using the shortest path. Your task is to help Dima reconstruct one possible route that Gennady might have taken.
Dima relies solely on verified sources, so you can be sure that a valid path exists.
Input
The first line contains 2 integers n and m (1 ≤ n, m ≤ 10^5) — the number of cities and roads, respectively. Each of the following m lines describes a road with three integers a_i, b_i, t_i (a_i ≠ b_i, 1 ≤ a_i, b_i ≤ n, 1 ≤ t_i ≤ 10^4) — representing the cities at the ends of the road and the travel time on it. The next line contains k — the number of cities that Gennady definitely visited. The last line lists k numbers — the identifiers of these cities. Each city in this list appears only once.
Output
On the first line, output the number of roads Gennady traveled on, and on the second line, list these roads in the order Gennady visited them. If there are multiple possible solutions, you may output any one of them.