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.*;
import java.text.DecimalFormat;
import java.util.*;
public class Main
{
    public static void main(String[] args) throws Exception
    {
        Reader in = new Reader();
        int t = 1;
        // t = ni();
        while(t-->0){
            int n = ni(), m = ni(), k= ni();
            long p = ni();
            long a[][] = new long[n][m];
            Queue<Long> row = new PriorityQueue<Long>(new Comparator<Long>() {
                @Override
                public int compare(Long a, Long b){
                    return (int)(b-a);
                }
            });
            Queue<Long> col = new PriorityQueue<Long>(new Comparator<Long>() {
                @Override
                public int compare(Long a, Long b){
                    return (int)(b-a);
                }
            });
            long sum = 0;
            long b[] = new long[m];
            for(int i=0;i<n;i++){
                sum = 0;
                for(int j=0;j<m;j++){
                    a[i][j] = ni();
                    sum += a[i][j];
                    b[j] += a[i][j];
                }
                // pr("sum: "+sum);
                row.add(sum);
            }
            for(int i=0;i<m;i++){
                col.add(b[i]);
            }
            long anser = 0;
            long colSum[] = new long[k+1];
            long rowSum[] = new long[k+1];
            for(int i=1;i<=k;i++){
                rowSum[i] = rowSum[i-1] + row.peek();
                anser = row.peek();
                row.poll();
                row.add(anser - p*m);
            }
            for(int i=1;i<=k;i++){
                colSum[i] = colSum[i-1] + col.peek();
                anser = col.peek();
                col.poll();
                col.add(anser - p*n);
            }
            anser = -1*inf;
            for(int i=0;i<=k;i++){
                anser = max(anser, (colSum[i] + rowSum[k-i] - ((long)i)*(k-i)*p));
            }
            pr(anser);
        }
        sop(ans);
    }
    static final long mod=1000000007l;
    static final long inf=1000_000_000_000_000_00l;
    static StringBuilder ans=new StringBuilder();
    static Reader in=new Reader();
    static final double eps=1e-9;
    
    //////////////////////////////////
    ////input functions/////////////////
    static int ni(){return Integer.parseInt(in.next());}
    static long nl(){return Long.parseLong(in.next());}
    static String ns(){return in.next();}
    static double nd(){return Double.parseDouble(in.next());}
    static int[] nia(int n){int a[]=new int[n];for(int i=0; i<n; i++)a[i]=ni();return a;}
    static int[] pnia(int n){int a[]=new int[n+1];for(int i=1; i<=n; i++)a[i]=ni();return a;}
    static long[] nla(int n){long a[]=new long[n];for(int i=0; i<n; i++)a[i]=nl();return a;}
    static String[] nsa(int n){String a[]=new String[n];for(int i=0; i<n; i++)a[i]=ns();return a;}
    static double[] nda(int n){double a[]=new double[n];for(int i=0; i<n; i++)a[i]=nd();return a;}
    
    //////output functions////////////////
    static void pr(Object a){ans.append(a+"\n");}
    static void pr(){ans.append("\n");}
    static void p(Object a){ans.append(a);}
    static void pra(int[]a){for(int i:a)ans.append(i+" ");ans.append("\n");}
    static void pra(long[]a){for(long i:a)ans.append(i+" ");ans.append("\n");}
    static void pra(String[]a){for(String i:a)ans.append(i+" ");ans.append("\n");}
    static void pra(double[]a){for(double i:a)ans.append(i+" ");ans.append("\n");}
    static void sop(Object a){System.out.print(a);}
    static void sopln(Object a){System.out.println(a);}
    static void flush(){System.out.print(ans);ans=new StringBuilder();}
    
    static void exit(){System.out.print(ans);System.exit(0);}
    static int min(int... a){int min=a[0];for(int i:a)min=Math.min(min, i);return min;}
    static int max(int... a){int max=a[0];for(int i:a)max=Math.max(max, i);return max;} 
    static int gcd(int... a){int gcd=a[0];for(int i:a)gcd=gcd(gcd, i);return gcd;}  
    static long min(long... a){long min=a[0];for(long i:a)min=Math.min(min, i);return min;}
    static long max(long... a){long max=a[0];for(long i:a)max=Math.max(max, i);return max;} 
    static long gcd(long... a){long gcd=a[0];for(long i:a)gcd=gcd(gcd, i);return gcd;}  
    static String pr(String a, long b){String c="";while(b>0){if(b%2==1)c=c.concat(a);a=a.concat(a);b>>=1;}return c;}
    static long powm(long a, long b, long m){long an=1;long c=a;while(b>0){if(b%2==1)an=(an*c)%m;c=(c*c)%m;b>>=1;}return an;}
    static int gcd(int a, int b){if(b==0)return a;return gcd(b, a%b);}
    static long gcd(long a, long b){if(b==0)return a;return gcd(b, a%b);}
    
    static class Reader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public Reader() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }
        String next() {while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {tokenizer = new StringTokenizer(reader.readLine());}
            catch (IOException e) {throw new RuntimeException(e);}}
            return tokenizer.nextToken();}
            int nextInt() {return Integer.parseInt(next());}
            long nextLong() {return Long.parseLong(next());}
            double nextDouble() {return Double.parseDouble(next());}
        }
        
    }