N, M, W = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) D = list(map(int, input().split())) for i in range(M): A.append(-C[i]) B.append(-D[i]) N += M z = 10*W DP = [[-10**18]*(20*W+1) for _ in range(N+1)] DP[0][z] = 0 for i in range(N): for j in range(19*W): DP[i+1][j] = max(DP[i+1][j], DP[i][j]) if j + A[i] >= 0: DP[i+1][j+A[i]] = max(DP[i+1][j+A[i]], DP[i][j] + B[i]) ans = -10**18 for i in range(z+W+1): ans = max(ans, DP[N][i]) print(ans) # print(DP)