In the first line of input integers N, K, and L are given — the number of subscribers in a cellular network company (2 ≤ N ≤ 105), the number of junctions (1 ≤ K ≤ 105), and the number of pedestrian walks (1 ≤ L ≤ 105) in the city, respectively.
On the next N lines of input Si (1 ≤ Si ≤ K) numbers are given — initial positions of subscribers (in the terms of transport graph junctions).
The next L lines of input pedestrian paths are given in the form of integers Bi, Ci and Di separated by spaces. Each line denotes that there is a two-way pedestrian path between junctions Bi and Ci (1 ≤ Bi,Ci ≤ K, Bi != Ci) with a length of Di (1 ≤ Di ≤ 5000) kilometers.