The mayor of RMRCity wants an emergency landline telephone network for the case where a serious disaster cuts the city off from the outside world. Some pairs of buildings can be joined by a direct wire line, and the city engineers have already estimated the cost of joining any such pair.
Find the cheapest network that connects all buildings and obeys the following security rule. A call from building A to building B may be routed along any simple path of the network, that is, a path that never repeats a building. The city also has insecure buildings, each home to one or more people with serious criminal records. The mayor wants only calls meant for an insecure building to reach it. In other words, a call from building A to building B must not pass through an insecure building C that differs from A and B.
The input is a single test case.
The first line contains three integers n, m, p. Here n is the number of buildings with 1≤n≤1000, m is the number of building pairs that can be connected directly with 0≤m≤100000, and p is the number of insecure buildings with 0≤p≤n. The buildings are numbered 1 through n.
The second line contains the p distinct numbers of the insecure buildings. When p is 0, the second line is empty.
Each of the next m lines contains three integers xi, yi, ℓi describing one possible direct line. Here xi and yi are the two distinct buildings the line joins (1≤xi,yi≤n), and ℓi is the estimated cost of joining them (1≤ℓi≤10000). No pair of buildings appears more than once in these m lines.
Print the cost of the cheapest network that obeys the security rule. If no such network exists, print impossible.