import heapq N,M,K=map(int,input().split()) L=[[]for i in range(N+1)] l=[[]] C=[1 for i in range(N+1)] for i in range(M): a,b,c=map(int,input().split()) L[a].append((b,c)) L[b].append((a,c)) l.append([a,b,c]) z=[] if K>0: for i in range(K): n=int(input()) z.append(n) else: x=0 Z=10**9 for i in range(1,M+1): if l[i][2]