import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); 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[] terminals = new int[v]; for (int i = 0; i < v; i++) { terminals[i] = sc.nextInt() - 1; } int[] yen = new int[v]; for (int i = 0; i < v; i++) { yen[i] = sc.nextInt(); } int[] mins = new int[v]; for (int i = 0; i < v; i++) { mins[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++) { graph.get(starts[i]).add(new Route(terminals[i], yen[i], mins[i])); } int[][] costs = new int[n][c + 1]; for (int[] arr : costs) { Arrays.fill(arr, Integer.MAX_VALUE); } PriorityQueue queue = new PriorityQueue<>(); queue.add(new Path(0, 0, c)); while (queue.size() > 0) { Path p = queue.poll(); if (p.yen < 0 || costs[p.idx][p.yen] <= p.value) { continue; } costs[p.idx][p.yen] = p.value; for (Route r : graph.get(p.idx)) { queue.add(new Path(r.idx, p.value + r.value, p.yen - r.yen)); } } int ans = Integer.MAX_VALUE; for (int x : costs[n - 1]) { ans = Math.min(ans, x); } if (ans == Integer.MAX_VALUE) { System.out.println(-1); } else { System.out.println(ans); } } static class Path implements Comparable { int idx; int value; int yen; public Path(int idx, int value, int yen) { this.idx = idx; this.value = value; this.yen = yen; } public int compareTo(Path another) { return value - another.value; } } static class Route { int idx; int yen; int value; public Route(int idx, int yen, int value) { this.idx = idx; this.yen = yen; this.value = value; } } }