import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int m = sc.nextInt(); int count = sc.nextInt(); int start = sc.nextInt(); int limit = start + sc.nextInt(); List> graph = new ArrayList<>(); for (int i = 0; i < n; i++) { graph.add(new ArrayList<>()); } for (int i = 0; i < m; i++) { int a = sc.nextInt() - 1; int b = sc.nextInt() - 1; int c = sc.nextInt(); graph.get(a).add(new Path(b, c)); graph.get(b).add(new Path(a, c)); } boolean[] hasRest = new boolean[n]; while (count-- > 0) { hasRest[sc.nextInt() - 1] = true; } PriorityQueue queue = new PriorityQueue<>(); queue.add(new Path(0, 0, 0)); long[][] costs = new long[2][n]; for (long[] arr : costs) { Arrays.fill(arr, Long.MAX_VALUE); } while (queue.size() > 0) { Path p = queue.poll(); if (costs[p.type][p.idx] <= p.value) { continue; } costs[p.type][p.idx] = p.value; if (p.type == 0 && hasRest[p.idx] && p.value <= limit) { queue.add(new Path(1, p.idx, Math.max(start, p.value) + 1)); } for (Path x : graph.get(p.idx)) { queue.add(new Path(p.type, x.idx, p.value + x.value)); } } System.out.println(costs[1][n - 1] == Long.MAX_VALUE ? -1 : costs[1][n - 1]); } static class Path implements Comparable { int type; int idx; long value; public Path(int type, int idx, long value) { this.type = type; this.idx = idx; this.value = value; } public Path(int idx, long value) { this(0, idx, value); } public int compareTo(Path another) { return Long.compare(value, another.value); } } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }