INF = 1<<32 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())) G = [[] for _ in range(N)] for i in range(V): G[S[i]-1].append((T[i]-1, Y[i], M[i])) DP = [[INF] * (C+1) for _ in range(N)] DP[0][0] = 0 for pos in range(N): for pre,yen,minute in G[pos]: for i in range(C): if i + yen <= C: DP[pre][i+yen] = min(DP[pre][i+yen], DP[pos][i] + minute) for i in range(C): DP[pos][i+1] = min(DP[pos][i], DP[pos][i+1]) if DP[-1][-1] == INF: print(-1) else: print(DP[-1][-1])