Starpucks

You've gone to work for Starpucks, a new and hot coffee cafe chain. Starpucks likes to make it convenient for people to visit their cafes. As such, they like anyone to be close by to a Starpucks cafe so they can easily visit. For this reason, Starpucks builds cafes on as many of the city's streets' intersections as possible.

Model the city as follows. The city has up to 500 intersections. The intersections are connected by road segments of various lengths. (No more than 20 road segments will intersect at a given intersection.) The location of Starpucks cafes are at these intersections. There may be more than one Starpucks cafe per intersection. (Of course!)

Input

The input begins with a single positive integer on a line by itself indicating the number of the cases following. (The cases are described below.) This line is followed by a blank line. There is also a blank line between consecutive cases.

The first line of input contains two positive integers: f,the number of existing Starpucks cafes (f ≤ 100) and i, the number of intersections (i ≤ 500). The intersections are numbered from 1 to i, consecutively. f lines follow; each contains the intersection number at which an existing cafe is found. A number of lines follow, each containing three positive integers: the number of an intersection, the number of a different intersection, and the length of the road segment connecting the intersections. All road segments are two-way, and there will exist a route between any pair of intersections.

Output

The output for each test case is a single integer on its own line. The outputs of consecutive cases should be separated by a blank line.

The single integer for a test case should be the lowest intersection number at which a new cafe should be built so as to minimize the maximum distance from any intersection to the nearest cafe.

Sample Input

1

1 6
2
1 2 10
2 3 10
3 4 10
4 5 10
5 6 10
6 1 10

Sample Output

5