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())) z = zip(S, T, Y, M) dp = [[None] * (C + 1) for i in range(N)] dp[0][0] = 0 for s, t, y, m in sorted(z, key = lambda x:(x[0], x[1])): for j in range(C + 1): a = dp[s - 1][j] if a is not None: q = y + j if C < q: break p = t - 1 x = a + m if dp[p][q] is None or x < dp[p][q]: dp[p][q] = x o = None for x in dp[N - 1]: if x is not None: if o is None or x < o: o = x if o is None: print(-1) else: print(o)