# Notices

*"Unix is user friendly. It just happens to be very selective about who it decides to make friends with."*ACM is planning to organize a UNIX based event

*CodeShell*soon after mid-sems. So, Nimesh Ghelani, the Secretary, has been assigned the job of making sure that notices have been put up in every hostel. So, he sets out from R&D building with S copies of notices, where S is the number of hostels in BIT Mesra. He has to go S hostels, complete the formalities at every hostel (which takes negligible time), and return back to R&D to report that the job is done. Nims intends to find the optimal route so as to minimize the time and energy wasted on this task.

He has an BIT map data which lists N landmarks numbered from 0 to N-1. Out of these N landmarks, S of them are hostels. R&D is marked as landmark 0. There are M routes which connect different landmarks. He asks for your help to find the optimal route for him because this trivial route finding is not worth the time of such an excellent coder.

**Input Specification**

Input consists of number of test cases. Read till EOF.

Every test case starts with two integers N and M on the first line. M lines follow containing two landmark and distance between them.(L

_{i1},L

_{i2},D

_{i}).Next line contains single integer S. S lines follow listing the landmark numbers (H

_{i}) for each hostel.

Every test case is followed by a blank line.

**Output Specifications**

Output single integer for every test case which is the minimum distance Nims has to travel.

**Constraints**

No. of test cases <= 15

0 <= L

_{i1},L

_{i2}< N

0 <= S <= 10

1 <= H

_{i}< N

For 2/3

^{rd}test cases

1 <= N,M <= 10

1 <= D

_{i}<= 10

For 1/3

^{rd}test cases

1 <= N,M <= 100000

1 <= D

_{i}<= 100000

All routes between the landmarks are bidirectional.

**Sample Test Case**

*Input*

```
```

3 3

0 1 2

1 2 4

2 0 1

2

1

2

4 6

0 1 1

1 2 1

2 3 1

3 0 1

0 2 5

1 3 5

3

1

2

3

*Output*

```
```

6

4

*Problem Setter : Shikhar Sharad*

**Languages:**AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text