import itertools import heapq INF = 10 ** 9 N,M,K = map(int,input().split()) R = set([i-1 for i in map(int,input().split())]) lR = list(R) route = [[] for _ in [0]*N] edge = [0]*M st = set([0,N-1]) for i in range(M): A,B,C = map(int,input().split()) A -= 1; B -= 1 if(i in R): edge[i] = [A,B,C] st.add(A); st.add(B) route[A].append((B,C)) route[B].append((A,C)) def dijkstra(route): dist = [[-1]*N for _ in [0]*N] for i in st: q = [(0,i)] cnt = 0 while(q and cnt < N): d,v = heapq.heappop(q) if(dist[i][v] == -1): cnt += 1 dist[i][v] = d for nv,nd in route[v]: heapq.heappush(q,(d + nd,nv)) return dist ans = INF rsum = sum(edge[i][2] for i in R) dist = dijkstra(route) for rbit in range(1 << K): b = [(rbit >> i) & 1 for i in range(K)] dp = [[INF]*K for i in range(1 << K)] for i in range(K): p = edge[lR[i]][b[i]] dp[1 << i][i] = dist[0][p] + rsum for bit in range(1, 1 << K): if not(bit): continue for s in range(K): p = edge[lR[s]][b[s]^1] if not(bit & (1 << s)): continue for t in range(K): np = edge[lR[t]][b[t]] k = bit | (1 << t) d = dp[bit][s] + dist[p][np] if((bit & (1 << t)) == 0 and dp[k][t] > d): dp[k][t] = d c = INF for i in range(K): p = edge[lR[i]][b[i]^1] d = dp[-1][i] + dist[p][N-1] if(c > d): c = d if(ans > c): ans = c print(ans)