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 size = sc.nextInt(); int[] starts = new int[size]; int[] ends = new int[size]; int[] costs = new int[size]; int[] times = new int[size]; for (int i = 0; i < size; i++) { starts[i] = sc.nextInt() - 1; } for (int i = 0; i < size; i++) { ends[i] = sc.nextInt() - 1; } for (int i = 0; i < size; i++) { costs[i] = sc.nextInt(); } for (int i = 0; i < size; i++) { times[i] = sc.nextInt(); } ArrayList> graph = new ArrayList<>(); for (int i = 0; i < n; i++) { graph.add(new ArrayList<>()); } for (int i = 0; i < size; i++) { graph.get(starts[i]).add(new Path(ends[i], costs[i], times[i])); } PriorityQueue queue = new PriorityQueue<>(); queue.add(new Path(0, c, 0)); int[] values = new int[n]; Arrays.fill(values, Integer.MAX_VALUE); while (queue.size() > 0) { Path p = queue.poll(); if (values[p.idx] <= p.time) { continue; } values[p.idx] = p.time; for (Path x : graph.get(p.idx)) { if (x.cost > p.cost) { continue; } queue.add(new Path(x.idx, p.cost - x.cost, p.time + x.time)); } } if (values[n - 1] == Integer.MAX_VALUE) { System.out.println(-1); } else { System.out.println(values[n - 1]); } } 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) { if (cost == another.cost) { return time - another.time; } else { return another.cost - cost; } } } }