void run(){
		Scanner sc = new Scanner(System.in);
		dp = new int[30][51][6];
		for(;;){
			C = sc.nextInt(); D = sc.nextInt(); W = sc.nextInt(); X = sc.nextInt();
			if((C|D|W|X)==0)break;
			E = new int[C][D]; F = new int[C][D];
			for(int i=0;i<C;i++)for(int j=0;j<D;j++)E[i][j]=sc.nextInt();
			for(int i=0;i<C;i++)for(int j=0;j<D;j++)F[i][j]=sc.nextInt();
			for(int i=0;i<D;i++)for(int j=0;j<=W;j++)for(int k=0;k<=X;k++)dp[i][j][k]=-1;
			System.out.println(get(0, W, X));
		}
	}