from collections import defaultdict

INF = 1 << 60
N = int(input())
C = int(input())
V = int(input())
S = list(map(lambda x: int(x)-1, input().split()))
T = list(map(lambda x: int(x)-1, input().split()))
Y = list(map(int, input().split()))
M = list(map(int, input().split()))

adj = defaultdict(list)
for s, t, y, m in zip(S, T, Y, M):
    adj[s].append((t, y, m))

dp = [[INF] * (C+1) for _ in range(N)]
dp[0][0] = 0
# dp[i][j]
# i : 町 i にいて
# j : コストが j のときの
# 最短時間
for i in range(N):
    for j in range(C):
        if dp[i][j] == INF: continue
        for t, y, m in adj[i]:
            if j+y > C: continue
            dp[t][j+y] = min(dp[t][j+y], dp[i][j] + m)

ans = min(dp[N-1])
if ans == INF:
    print(-1)
else:
    print(ans)