import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline import heapq INF = 10**18 from collections import defaultdict def main(): n, m, k = map(int, input().split()) R = list(map(int, input().split())) R = [r-1 for r in R] toid = {} for i, r in enumerate(R): toid[r] = i g = [[] for i in range(n)] for i in range(m): a, b, c = map(int, input().split()) a, b = a-1, b-1 if i in toid: j = toid[i] g[a].append((c, b, j)) g[b].append((c, a, j)) else: g[a].append((c, b, -1)) g[b].append((c, a, -1)) import heapq INF = 10**18 hq = [] heapq.heapify(hq) heapq.heappush(hq, (0, 0)) dist = defaultdict(lambda: INF) dist[0] = 0 while hq: d, x = heapq.heappop(hq) if dist[x] < d: continue b, v = divmod(x, n) for c, nv, i in g[v]: if i != -1: nb = b|(1< dist[x]+c: dist[nx] = dist[x]+c heapq.heappush(hq, (dist[nx], nx)) t = ((1<