As we know, DZY loves playing games. One day DZY decided to play with a n × m matrix. To be more precise, he decided to modify the matrix with exactly k operations.

Each modification is one of the following:

  1. Pick some row of the matrix and decrease each element of the row by p. This operation brings to DZY the value of pleasure equal to the sum of elements of the row before the decreasing. 
  2. Pick some column of the matrix and decrease each element of the column by p. This operation brings to DZY the value of pleasure equal to the sum of elements of the column before the decreasing. 



DZY wants to know: what is the largest total value of pleasure he could get after performing exactly k modifications? Please, help him to calculate this value.

Input

The first line contains four space-separated integers n, m, k and p (1 ≤ n, m ≤ 103; 1 ≤ k ≤ 106; 1 ≤ p ≤ 100).

Then n lines follow. Each of them contains m integers representing aij (1 ≤ aij ≤ 103) — the elements of the current row of the matrix.

Output

Output a single integer — the maximum possible total pleasure value DZY could get.

Examples

Input

2 2 2 2
1 3
2 4


Output

11


Input

2 2 5 2
1 3
2 4


Output

11

Note

For the first sample test, we can modify: column 2, row 2. After that the matrix becomes:
    
    
      
    1 1  
    0 0  
      
    

For the second sample test, we can modify: column 2, row 2, row 1, column 1, column 2. After that the matrix becomes:
    
    
      
    -3 -3  
    -2 -2  
      
    
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.InputMismatchException;
import java.util.TreeMap;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    /////////////////////////////////////////////////////////////

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt(),m=in.nextInt(),k=in.nextInt(),p=in.nextInt();
    int[][] A= new int[n][m];
        for (int i = 0; i < n; i++) {
         A[i]=in.readIntArray(m);
        }

//     int[] rowsk= new int[2000009];
//     int[] colk= new int[2000009];
//        int zero=1000002;
        TreeMap<Long,Integer> tm= new TreeMap<Long, Integer>();
        TreeMap<Long,Integer> tmc= new TreeMap<Long, Integer>();
        for (int i = 0; i < n; i++) {
          long rs=0;
            for (int j = 0; j < m; j++) {
                rs+=A[i][j];
            }
            if(tm.containsKey(rs))tm.put(rs,tm.get(rs)+1);
            else tm.put(rs,1);


        }
        for (int i = 0; i < m; i++) {
          long rs=0;
            for (int j = 0; j < n; j++) {
                rs+=A[j][i];
            }
            if(tmc.containsKey(rs))tmc.put(rs,tmc.get(rs)+1);
            else tmc.put(rs,1);

        }

   int L=k+10;
   long[] orderR= new long[L];
        long[] orderC= new long[L];
        for (int i = 0; i < L-3; i++) {
            orderR[i]=tm.lastKey();
            if(tm.get(orderR[i])==1)tm.remove(orderR[i]);
            else tm.put(orderR[i],tm.get(orderR[i])-1);
            long rs=orderR[i]-m*p;
            if(tm.containsKey(rs))tm.put(rs,tm.get(rs)+1);
            else tm.put(rs,1);
        }
        for (int i = 0; i < L-3; i++) {
            orderC[i]=tmc.lastKey();
            if(tmc.get(orderC[i])==1)tmc.remove(orderC[i]);
            else tmc.put(orderC[i],tmc.get(orderC[i])-1);
            long rs=orderC[i]-n*p;
            if(tmc.containsKey(rs))tmc.put(rs,tmc.get(rs)+1);
            else tmc.put(rs,1);
        }
        for (int i = 1; i <orderC.length ; i++) {
             orderC[i]+=orderC[i-1];
            orderR[i]+=orderR[i-1];
        }
   long ans=Long.MIN_VALUE;
       long pp=p;
        for (long rr = 0; rr <=k ; rr++)
        {
            long cc=k-rr;
            long diff=Math.abs(cc-rr);
//            long red= diff*pp*Math.min(cc,rr);
//            long min=Math.min(cc,rr);
//            if(min!=0)
//            red+= (min*(min+1)-1)*pp;
            long red= cc*(long)rr*pp;
            long vv = -red;
    //        System.out.println(rr+" "+cc+" "+vv);
            if(rr>0)vv+=orderR[(int)rr-1];
            if(cc>0)vv+=orderC[(int)cc-1];
   //         System.out.println(rr+" "+cc+" "+vv);
            ans=Math.max(ans,vv);
        }
//        deb(orderR);
//        deb(orderC);
        out.println(ans);
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public int[] readIntArray(int n) {
        int[] ret = new int[n];
        for (int i = 0; i < n; i++) {
            ret[i] = nextInt();
        }
        return ret;
    }

}

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }


}

