#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
using namespace std;

#define N 102
#define T 30002

int dp[2][N];
bool mark[T];

struct Gangster
{
	int tt, p, s; 
} g[N];

inline int MAX(int a, int b)
{
	return a>b?a:b;
}

int main()
{
	int n, k, t;
    int i, j, p;

	memset(mark, false, sizeof(mark));
	scanf("%d %d %d", &n, &k, &t);
    for(i = 1; i <= n; i++){
		scanf("%d", &g[i].tt);
		mark[g[i].tt] = true;
	}
	for(i = 1; i <= n; i++)
		scanf("%d", &g[i].p);
	for(i = 1; i <= n; i++)
		scanf("%d", &g[i].s);

	bool flag = false;
	int w;
    memset(dp, 0, sizeof(dp));
    for(i = 0; i <= t; i++){
		for(j = 0; j <= i && j <= k; j++){
			w = 0;
			if(mark[i])
			{
                for(p = 1; p <= n; p++)
					if(g[p].s == j && g[p].tt == i)
                        w += g[p].p; 
			}
			if(j == 0) dp[i%2][j] = MAX(dp[1-i%2][j], dp[1-i%2][j+1]);
			else if(j == k) dp[i%2][j] = MAX(dp[1-i%2][j], dp[1-i%2][j-1]);
			else dp[i%2][j] = MAX(MAX(dp[1-i%2][j], dp[1-i%2][j-1]), dp[1-i%2][j+1]);
			dp[i%2][j] += w;
		}
	}
	int ans = 0;
	for(i = 0; i <= k; i++)
		if(ans < dp[t%2][i])
			ans = dp[t%2][i];
	printf("%d\n", ans);
	return 0;
}