The first line contains the number of vertices n and the number of edges m. (2≤n≤5000, 1≤m≤100000)
Each of the next m lines contains a, b and c, which means the edge joining vertex a and vertex b has length c. (1≤a,b≤n, 1≤c≤10000) Several edges may join the same pair of vertices, and an edge may have a equal to b. Edges have no direction.
The next line contains the number of home candidates p and the number of convenience stores q. (1≤p, 1≤q, 2≤p+q≤n)
The next line contains the p vertex numbers of the home candidates, and the line after that contains the q vertex numbers of the convenience stores. No number appears twice on the same line, and no vertex is both a home candidate and a convenience store.
A home candidate may be unable to reach any convenience store. Such a candidate is never picked. At least one home candidate can reach a convenience store.