n=int(input()) C=int(input()) e=[[] for i in range(n)] m=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())) for i in range(m): e[S[i]-1]+=[(T[i]-1,Y[i],M[i])] X=10**10 q=[[X]*(C+1) for i in range(n)] q[0][C]=0 for s in range(n-1): for c in range(C+1): if q[s][c]=0: q[t][c-y]=min(q[t][c-y],q[s][c]+m) print(min(q[n-1]) if min(q[n-1])