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