import java.util.*; import java.util.stream.*; import java.io.*; class Path { int to; long d; Path(int to ,long d){ this.to = to; this.d = d; } } class Node implements Comparable { int v; long dist; Node(int v, long dist){ this.v = v; this.dist = dist; } @Override public int compareTo(Node other){ if(this.dist > other.dist) return 1; else if(this.dist < other.dist) return -1; else return 0; } } class Edge { int a, b; long c; Edge(int a, int b, long c){ this.a = a; this.b = b; this.c = c; } } public class Main { static final int INF = 1<<30; static final long INFL = 1L<<59; static final int MOD = 1000000007; static final int MOD2 = 998244353; static List> g; static int n; static Long[] dijkstra(int from){ Long[] ret = new Long[n]; Arrays.fill(ret, INFL); ret[from] = 0L; Queue pq = new PriorityQueue<>(); pq.add(new Node(from, 0)); while(!pq.isEmpty()){ Node node = pq.poll(); if(node.dist > ret[node.v]) continue; for(Path path : g.get(node.v)){ if(node.dist + path.d < ret[path.to]){ ret[path.to] = node.dist + path.d; pq.add(new Node(path.to, ret[path.to])); } } } return ret; } public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter pw = new PrintWriter(System.out); n = fs.nextInt(); int m = fs.nextInt(); int k = fs.nextInt(); int[] r = new int[k]; for(int i = 0; i < k; i++) r[i] = fs.nextInt() - 1; g = new ArrayList<>(); for(int i = 0; i < n; i++) g.add(new ArrayList<>()); Edge[] edge = new Edge[m]; for(int i = 0; i < m; i++){ int a = fs.nextInt() - 1; int b = fs.nextInt() - 1; long d = fs.nextLong(); g.get(a).add(new Path(b, d)); g.get(b).add(new Path(a, d)); edge[i] = new Edge(a, b, d); } Set set = new HashSet<>(); set.add(0); set.add(n-1); for(int i = 0; i < k; i++){ set.add(edge[r[i]].a); set.add(edge[r[i]].b); } Map map = new HashMap<>(); for(int v : set){ Long[] t = dijkstra(v); map.put(v, t); } long[][][] dp = new long[1<