import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int c = sc.nextInt(); int v = sc.nextInt(); int[] starts = new int[v]; for (int i = 0; i < v; i++) { starts[i] = sc.nextInt() - 1; } int[] goals = new int[v]; for (int i = 0; i < v; i++) { goals[i] = sc.nextInt() - 1; } int[] costs = new int[v]; for (int i = 0; i < v; i++) { costs[i] = sc.nextInt(); } ArrayList> graph = new ArrayList<>(); for (int i = 0; i < n; i++) { graph.add(new ArrayList<>()); } for (int i = 0; i < v; i++) { int x = sc.nextInt(); graph.get(starts[i]).add(new Path(goals[i], costs[i], x)); graph.get(goals[i]).add(new Path(starts[i], costs[i], x)); } PriorityQueue queue = new PriorityQueue<>(); queue.add(new Path(0, c, 0)); int[][] values = new int[n][c + 1]; for (int[] arr : values) { Arrays.fill(arr, Integer.MAX_VALUE); } while (queue.size() > 0) { Path p = queue.poll(); if (values[p.idx][p.cost] <= p.time) { continue; } for (int i = p.cost; i >= 0 && values[p.idx][i] > p.time; i--) { values[p.idx][i] = p.time; } for (Path x : graph.get(p.idx)) { if (x.cost <= p.cost) { queue.add(new Path(x.idx, p.cost - x.cost, p.time + x.time)); } } } if (values[n - 1][0] == Integer.MAX_VALUE) { System.out.println(-1); } else { System.out.println(values[n - 1][0]); } } static class Path implements Comparable { int idx; int cost; int time; public Path(int idx, int cost, int time) { this.idx = idx; this.cost = cost; this.time = time; } public int compareTo(Path another) { return time - another.time; } } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }