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.util.*;
import java.io.*;
import java.math.*;
import java.lang.*;

public class Main {
    private static FastReader sc = new FastReader(System.in);
    private static OutputWriter out = new OutputWriter(System.out);

    public static void main(String[] args) {
        int r = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        long p = sc.nextInt();
        long[][] arr = new long[r][c];
        PriorityQueue<Long> rowSums = new PriorityQueue<>(Collections.reverseOrder());
        PriorityQueue<Long> colSums = new PriorityQueue<>(Collections.reverseOrder());
        for (int i = 0; i < r; i++) {
            long sum = 0;
            for (int j = 0; j < c; j++) {
                arr[i][j] = sc.nextInt();
                sum += arr[i][j];
            }
            rowSums.add(sum);
        }
        for (int j = 0; j < c; j++) {
            long sum = 0;
            for (int i = 0; i < r; i++) {
                sum += arr[i][j];
            }
            colSums.add(sum);
        }

        long[] ri = new long[k + 1];
        long[] ci = new long[k + 1];
        for (int i = 1; i <= k; i++) {
            long max = rowSums.remove();
            ri[i] = max + ri[i - 1];
            rowSums.add(max - c * p);
        }
        for (int i = 1; i <= k; i++) {
            long max = colSums.remove();
            ci[i] = max + ci[i - 1];
            colSums.add(max - r * p);
        }

        long ans = Long.MIN_VALUE;
        for (int i = 0; i <= k; i++) {
            ans = Math.max(ans, ri[i] + ci[k - i] - p * ((long) (k - i)) * ((long) i));
        }
        System.out.println(ans);
    }
}

class SegmentTree {
    int[] zeroes, ones, twos;
    int[] lazy;

    public SegmentTree(int n) {
        zeroes = new int[4 * n];
        ones = new int[4 * n];
        twos = new int[4 * n];
        lazy = new int[4 * n];
        build(0, n - 1, 0);
    }

    private void build(int sl, int sr, int si) {
        if (sl == sr) {
            zeroes[si] = 1;
            return;
        }
        int mid = (sl + sr) / 2;
        build(sl, mid, 2 * si + 1);
        build(mid + 1, sr, 2 * si + 2);
        zeroes[si] = zeroes[2 * si + 1] + zeroes[2 * si + 2];
    }

    public int query(int sl, int sr, int ql, int qr, int si) {
        if (lazy[si] == 1) {
            int two = twos[si];
            twos[si] = ones[si];
            ones[si] = zeroes[si];
            zeroes[si] = two;
            if (sl != sr) {
                lazy[2 * si + 1] = (lazy[2 * si + 1] + lazy[si]) % 3;
                lazy[2 * si + 2] = (lazy[2 * si + 2] + lazy[si]) % 3;
            }
            lazy[si] = 0;
        } else if (lazy[si] == 2) {
            int zero = zeroes[si];
            zeroes[si] = ones[si];
            ones[si] = twos[si];
            twos[si] = zero;
            if (sl != sr) {
                lazy[2 * si + 1] = (lazy[2 * si + 1] + lazy[si]) % 3;
                lazy[2 * si + 2] = (lazy[2 * si + 2] + lazy[si]) % 3;
            }
            lazy[si] = 0;
        }

        if (ql > sr || qr < sl) return 0;
        if (ql <= sl && qr >= sr) return zeroes[si];
        int mid = (sl + sr) / 2;
        return query(sl, mid, ql, qr, 2 * si + 1) + query(mid + 1, sr, ql, qr, 2 * si + 2);
    }

    public void update(int ql, int qr, int sl, int sr, int si) {
        if (lazy[si] == 1) {
            int two = twos[si];
            twos[si] = ones[si];
            ones[si] = zeroes[si];
            zeroes[si] = two;
            if (sl != sr) {
                lazy[2 * si + 1] = (lazy[2 * si + 1] + lazy[si]) % 3;
                lazy[2 * si + 2] = (lazy[2 * si + 2] + lazy[si]) % 3;
            }
            lazy[si] = 0;
        } else if (lazy[si] == 2) {
            int zero = zeroes[si];
            zeroes[si] = ones[si];
            ones[si] = twos[si];
            twos[si] = zero;
            if (sl != sr) {
                lazy[2 * si + 1] = (lazy[2 * si + 1] + lazy[si]) % 3;
                lazy[2 * si + 2] = (lazy[2 * si + 2] + lazy[si]) % 3;
            }
            lazy[si] = 0;
        }

        if (ql > sr || qr < sl) return;
        if (ql <= sl && qr >= sr) {
            int two = twos[si];
            twos[si] = ones[si];
            ones[si] = zeroes[si];
            zeroes[si] = two;
            if (sl != sr) {
                lazy[2 * si + 1] = (lazy[2 * si + 1]+ 1) % 3;
                lazy[2 * si + 2] = (lazy[2 * si + 2] + 1) % 3;
            }
            return;
        }

        int mid = (sl + sr) / 2;
        update(ql, qr, sl, mid, 2 * si + 1);
        update(ql, qr, mid + 1, sr, 2 * si + 2);
        zeroes[si] = zeroes[2 * si + 1] + zeroes[2 * si + 2];
        ones[si] = ones[2 * si + 1] + ones[2 * si + 2];
        twos[si] = twos[2 * si + 1] + twos[2 * si + 2];
    }
}

class FastReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }

        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1) {
            return -1;
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c == ',') {
                c = read();
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r') {
                buf.appendCodePoint(c);
            }
            c = read();
        }
        return buf.toString();
    }

    public String nextLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String nextLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines) {
            return nextLine();
        } else {
            return readLine0();
        }
    }

    public BigInteger nextBigInteger() {
        try {
            return new BigInteger(nextString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char nextCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, nextInt());
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return nextString();
    }

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}