N,M,K = map(int,input().split()) R = list(map(int,input().split())) G = [[] for _ in range(N+1)] #D = {v:i for i,v in enumerate(sorted(set(R)))} edge = dict() for i in range(M): a,b,c = map(int,input().split()) G[a].append((b,c)) G[b].append((a,c)) for j in range(K): if R[j] == i + 1: edge[(a,b)] = j edge[(b,a)] = j C = 10 ** 15 dp = [[C] * (1< dp[now][S]:continue for v,c in G[now]: if (now,v) in edge: T = S | (1 << edge[(now,v)]) else:T = S if dp[v][T] > d + c: dp[v][T] = d+c heapq.heappush(q,(d+c,v,T)) print(dp[N][(1<