import heapq 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())) G=[[] for _ in range(N)] for i in range(V): G[S[i]-1].append((M[i],Y[i],T[i]-1)) seen=[False]*N seen[0]=True hq=[(0,0,0)] heapq.heapify(hq) while(hq): t,c,v=heapq.heappop(hq) if seen[v]==1: continue seen[v]=1 if v==N-1: print(t) exit() for m,y,u in G[v]: if c+y<=C and seen[u]==False: heapq.heappush(hq,(t+m,c+y,u)) print(-1)