from heapq import heappop, heappush def main(): """ main """ N = int(input()) C = int(input()) V = int(input()) S = list(map(int, input().split())) T = list(map(int, input().split())) Y = list(map(int, input().split())) M = list(map(int, input().split())) ways_from = {} ways_from = [set() for i in range(N+1)] for i in range(V): ways_from[S[i]].add((T[i], Y[i], M[i])) # time, pos, cost heap = [(0, 1, 0)] res = -1 while heap: time, pos, cost = heappop(heap) if pos == N: res = time break for next_pos, way_cost, way_time in ways_from[pos]: next_cost = cost + way_cost if C < next_cost: continue heappush(heap, (time + way_time, next_pos, next_cost)) return res print(main())