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())) graph = [[] for _ in range(n)] for i in range(v): graph[s[i] - 1].append([t[i] - 1, y[i], m[i]]) INF = 10**9 dp = [[INF for i in range(c+1)] for j in range(n)] dp[0][0] = 0 for i in range(n): for j in range(c+1): if dp[i][j] == INF: continue for u in graph[i]: if u[1] + j > c: continue dp[u[0]][u[1] + j] = min(dp[u[0]][u[1] + j], dp[i][j] + u[2]) ans = min(dp[n-1]) if ans == INF: ans = -1 print(ans)