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.
/*
 * PDPM IIITDM Jabalpur
 * Asutosh Rana
 */

import java.util.*;
import java.io.*;
import java.math.*;

public class Main
{
    long MOD = 1000000007;
    InputReader in;BufferedReader br;PrintWriter out;
    public static void main (String[] args) throws java.lang.Exception
    {
        Main solver = new Main();
        solver.in = new InputReader(System.in);
        solver.br = new BufferedReader(new InputStreamReader(System.in));
        solver.out = new PrintWriter(System.out);
        solver.solve();
        solver.out.flush();
        solver.out.close();
    }

    int[][] A;
    int N,M,K;
    SegTree[] seg;
    public void solve(){
        
        int tc = 1;//in.readInt();
        
        for(int cas=1;cas<=tc;cas++){
            N = in.readInt();
            M = in.readInt();
            K = in.readInt();

            A = new int[M][N];
            for(int i=0;i<N;i++){
                for(int j=0;j<M;j++){
                    A[j][i] = in.readInt();
                }
            }

            seg = new SegTree[M];
            for(int i=0;i<M;i++){
                seg[i] = new SegTree(A[i]);
            }

            int l=0, r=N-1;
            while(l<=r){
                boolean flag = check(l);
                int mid = (l+r)/2;
                if(check(mid)==true){
                    l = mid+1;
                }
                else{
                    r = mid-1;
                }
            }

            long[] res = get(l-1);
            for(int i=0;i<M;i++){
                out.print(res[i]+" ");
            }
            out.println();
        }

    }

    long[] get(int l){
        long[] res = new long[M];
        for(int i=0;i+l-1<N;i++){
            int j = i+Math.max(0,l-1);
            long sum = 0;
            for(int k=0;k<M;k++){
                res[k] = seg[k].query(0,0,A[k].length-1, i, j);
                sum += res[k];
            }
            if(sum<=K){
                return res;
            }
        }
        return null;
    }

    boolean check(int l){
        for(int i=0;i+l-1<N;i++){
            int j = i+Math.max(0,l-1);
            long sum = 0;
            for(int k=0;k<M;k++){
                sum += seg[k].query(0,0,A[k].length-1, i, j);
            }
            if(sum<=K){
                return true;
            }
        }
        return false;
    }

    class SegTree{
        long[] tree;
        int[] A;
        public SegTree(int[] A){
            tree = new long[4*A.length];
            this.A = A;
            build(0,0,A.length-1);
        }
 
        public void build(int node, int start, int end){
            if(start==end){
                tree[node] = A[start];
            }
            else{
                int mid = (start+end)/2;
                build(2*node+1, start, mid);
                build(2*node+2, mid+1, end);
            
                tree[node] = Math.max(tree[2*node+1],tree[2*node+2]);
            }
        }
 
        public long query(int node, int start, int end, int l, int r){
            if(l<=start && end<=r){
                return tree[node];
            }
            if(start>r || end<l){
                return 0;
            }
            int mid = (start+end)/2;
            long res1 = query(2*node+1, start, mid, l, r);
            long res2 = query(2*node+2, mid+1, end, l, r);
            return Math.max(res1,res2);
        }
    }
    
}
 
class InputReader{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(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 readInt(){
        int c = read();
        while(isSpaceChar(c)) c = read();
        int sgn = 1;
        if (c == '-') {sgn = -1;c = read();}
        int 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 void readInt(int[] A){
        for(int i=0;i<A.length;i++)
            A[i] = readInt();
    }

    public long readLong() {
        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 void readLong(long[] A){
        for(int i=0;i<A.length;i++)
            A[i] = readLong();
    }

    public double readDouble() {
        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, readInt());
            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, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public char[] readCharA(){
        return readString().toCharArray();
    }

    public String readString() {
        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 c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

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

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

}