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 = {} for i in range(V): if ways_from.get(S[i]): ways_from[S[i]].append({'next': T[i], 'cost': Y[i], 'min': M[i]}) else: ways_from[S[i]] = [{'next': T[i], 'cost': Y[i], 'min': M[i]}] # time, pos, cost candidates = [(0, 1, 0)] res = None while candidates: candidate = heappop(candidates) if candidate[1] == N: res = candidate[0] break if not ways_from[candidate[1]]: continue for way in ways_from[candidate[1]]: next_cost = candidate[2] + way['cost'] if C < next_cost: continue heappush( candidates, (candidate[0] + way['min'], way['next'], next_cost)) return res or -1 print(main())