import sys input = lambda: sys.stdin.readline().rstrip() import heapq def 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())) # その道の長さ # 計算・出力 edges = [[] for _ in range(N)] # 辺の情報 [次の街, 通行料, 距離] for i in range(V): edges[S[i]-1].append([T[i]-1, Y[i], M[i]]) d = [[10**10]*(C+1) for _ in range(N)] # d[i][j] := 街 i に 料金 j でたどり着く最短距離 d[0][0] = 0 q = [[0, 0, 0]] # [総距離, 街, 料金] while q: prevD, prevV, prevC = heapq.heappop(q) if d[prevV][prevC] < prevD: continue for nextV, cost, dist in edges[prevV]: nextD = prevD + dist nextC = prevC + cost if nextC <= C and nextD < d[nextV][nextC]: d[nextV][nextC] = nextD heapq.heappush(q, [nextD, nextV, nextC]) ans = min(d[-1]) print(ans if ans < 10**10 else -1) if __name__ == "__main__": main()