An army of n droids is lined up in one row. Each droid is described by m integers a1, a2, ..., am, where ai is the number of details of the i-th type in this droid's mechanism. R2-D2 wants to destroy the sequence of consecutive droids of maximum length. He has m weapons, the i-th weapon can affect all the droids in the army by destroying one detail of the i-th type (if the droid doesn't have details of this type, nothing happens to it). 

A droid is considered to be destroyed when all of its details are destroyed. R2-D2 can make at most k shots. How many shots from the weapon of what type should R2-D2 make to destroy the sequence of consecutive droids of maximum length?

Input

The first line contains three integers n, m, k (1 ≤ n ≤ 105, 1 ≤ m ≤ 5, 0 ≤ k ≤ 109) — the number of droids, the number of detail types and the number of available shots, respectively.

Next n lines follow describing the droids. Each line contains m integers a1, a2, ..., am (0 ≤ ai ≤ 108), where ai is the number of details of the i-th type for the respective robot.

Output

Print m space-separated integers, where the i-th number is the number of shots from the weapon of the i-th type that the robot should make to destroy the subsequence of consecutive droids of the maximum length.

If there are multiple optimal solutions, print any of them. 

It is not necessary to make exactly k shots, the number of shots can be less.

Examples

Input

5 2 4
4 0
1 2
2 1
0 2
1 3


Output

2 2


Input

3 2 4
1 2
1 3
2 2


Output

1 3

Note

In the first test the second, third and fourth droids will be destroyed. 

In the second test the first and second droids will be destroyed.
import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Main{
    final boolean isFileIO =  false;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    String delim = " ";

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.initIO();
        m.solve();
        m.in.close();
        m.out.close();
    }

    public void initIO() throws IOException {
        if(!isFileIO) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String nt() throws IOException {
        if(!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken(delim);
    }

    String rl() throws IOException {
        return in.readLine();
    }

    int ni() throws IOException {
        return Integer.parseInt(nt());
    }

    long nl() throws IOException {
        return Long.parseLong(nt());
    }

    double nd() throws IOException {
        return Double.parseDouble(nt());
    }

    class Pair {
        public int x, y;
        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    class SparseTable {

        int[][] a;
        int[] log;
        int height;
        public SparseTable(int[] b) {
            int n = b.length;
            log = new int[n + 1];
            for(int i = 1; i <= n; i++) {
                for(int j = 0; j < 20; j++) {
                    if((1 << j) <= i) {
                        log[i] = j;
                    }
                }
            }
            this.height = log[n] + 1;
            a = new int[this.height][n];
            for(int i = 0; i < n; i++) {
                a[0][i] = b[i];
            }
            for(int i = 1; i < height; i++) {
                int rem = (1 << i) - 1;
                for(int j = 0; j < n - rem; j++) {
                    a[i][j] = Math.max(a[i - 1][j], a[i - 1][j + (1 << (i - 1))]);
                }
            }

        }

        public int getMax(int left, int right) {
            int pow = log[(right - left + 1)];
            return Math.max(a[pow][left],
                    a[pow][right - (1 << pow) + 1]);
        }

    }

    class SegmentTree {
        int[] a;
        int size = 0;
        public int leafs;
        public SegmentTree(int[] b) {
            int n = b.length;
            int leafs = 1;
            while(leafs < n) {
                leafs *= 2;
            }
            size = leafs * 2 - 1;
            a = new int[size];
            this.leafs = leafs;
            for(int i = leafs - 1; i < leafs - 1 + n; i++) {
                a[i] = b[i - leafs + 1];
            }
            for(int i = leafs - 1 + n; i < size; i++) {
                a[i] = Integer.MIN_VALUE;
            }
            for(int i = leafs - 2; i >= 0; i--) {
                a[i] = Math.max(a[i * 2 + 1], a[i * 2 + 2]);
            }
        }

        public int getMax(int treeLeft, int treeRight, int queryLeft, int queryRight, int node) {
            if(queryLeft > queryRight) {
                return Integer.MIN_VALUE;
            }
            if(treeLeft == queryLeft && treeRight == queryRight) {
                return a[node];
            }
            int mid = treeLeft + (treeRight - treeLeft) / 2;
            return Math.max(getMax(treeLeft, mid, queryLeft, Math.min(mid, queryRight), node * 2 + 1),
                    getMax(mid + 1, treeRight, Math.max(queryLeft, mid + 1), queryRight, node * 2 + 2));
        }

    }

    public void solve() throws IOException {
        int n, m, k;
        n = ni(); m = ni(); k = ni();
        int[][] a = new int[m][n];
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                a[j][i] = ni();
            }
        }
        SparseTable[] sts = new SparseTable[m];
        for(int i = 0; i < m; i++) {
            sts[i] = new SparseTable(a[i]);
        }
        int left, right, mid, sum;
        left = right = mid = sum = 0;
        int total = 0;
        int[] res = new int[m];
        for(int i = 0; i < n; i++) {
            left = 1;
            right = i + 1;
            mid = 0;
            while(left < right) {
                mid = left + (right - left) / 2;
                sum = 0;
                for(int j = 0; j < m; j++) {
                    sum += sts[j].getMax(i - mid + 1, i);
                }
                if(sum <= k) {
                    left = mid + 1;
                } else {
                    right = mid;
                }
            }
            sum = 0;
            for(int j = 0; j < m; j++) {
                sum += sts[j].getMax(i - left + 1, i);
            }
            if(sum > k) {
                left--;
            }
            if(left == 0) {
                continue;
            }
            sum = 0;
            for(int j = 0; j < m; j++) {
                sum += sts[j].getMax(i - left + 1, i);
            }
            if(left > total && sum <= k) {
                for(int j = 0; j < m; j++) {
                    res[j] = sts[j].getMax(i - left + 1, i);
                }
                total = left;
            }
        }
        for(int i = 0; i < m; i++) {
            out.print(res[i] + " ");
        }

    }
}

class Utils {

    public static long binpow(long a, long exp, long mod) {
        if(exp == 0) {
            return 1;
        }
        if(exp % 2 == 0) {
            long temp = binpow(a, exp / 2, mod);
            return (temp * temp) % mod;
        } else {
            return (binpow(a, exp - 1, mod) * a) % mod;
        }
    }

    public static long inv(long a, long mod) {
        return binpow(a, mod - 2, mod);
    }

    public static long addmod(long a, long b, long mod) {
        return ((a + b) % mod + mod) % mod;
    }

    public static long gcd(long a, long b) {
        if(b == 0)
            return a;
        return gcd(b, a % b);
    }

    //mul must be < 10^18
    public static long mulmod(long a, long b, long mod) {
        return (a * b + (((a * b) / mod) + 1) * mod) % mod;
    }
}