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()))
E = [[] for _ in range(N)]
for i in range(V):
    E[S[i] - 1].append((T[i] - 1, Y[i], M[i]))
INF = 10 ** 5
dp = [[INF] * (C + 1) for _ in range(N)]
dp[0][0] = 0
for i in range(N - 1):
    for t, y, m in E[i]:
        for j in range(C - y + 1):
            dp[t][j + y] = min(dp[t][j + y], dp[i][j] + m)
ans = min(dp[-1])
if ans == INF:
    print(-1)
else:
    print(ans)