Whisker Bells
Gats is walking through a city with crossings and two-way alleys. The crossings are numbered . Each alley has a positive walking time and one bell tone from to .
At any moment, Gats remembers the tone of the last alley he walked through. He refuses to leave a crossing through an alley with the same tone as the one he remembers. If there is a milk fountain at the crossing, he forgets the remembered tone before choosing the next alley. At the start, he remembers no tone.
A walk may visit crossings and alleys more than once. Find the minimum total walking time for Gats to get from crossing to crossing .
Input
The first line contains integers , , , , and (, , , and ), the number of crossings, the number of alleys, the number of possible bell tones, the starting crossing, and the target crossing. The second line contains an integer (), followed by distinct integers , the crossings with milk fountains. For each with , . If , this line contains only the integer . The next lines describe the alleys. For each with , the -th of these lines contains integers , , , and (, , , and ). This means there is a two-way alley between crossings and with walking time and bell tone . There may be more than one alley between the same two crossings. All tokens are separated by spaces.
Output
Print one line containing a single integer. If at least one valid walk from to exists, this integer must be the minimum possible total walking time. Otherwise, print .
Samples
Sample 1
Input
4 3 2 1 4 1 2 1 2 5 1 2 3 5 1 3 4 1 2
Output
11
The walk has bell tones . The repeated tone is allowed because crossing has a milk fountain.