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.
// Don't place your source in a package


import javax.swing.*;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
import java.util.stream.Stream;



// Please name your class Main
public class Main {
    static FastScanner fs=new FastScanner();
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }
        int Int() {
            return Integer.parseInt(next());
        }

        long Long() {
            return Long.parseLong(next());
        }

        String Str(){
            return next();
        }
    }


    public static void main (String[] args) throws java.lang.Exception {
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        //reading /writing file
        //Scanner sc=new Scanner(new File("input.txt"));
        //PrintWriter pr=new PrintWriter("output.txt");


        int T=1;
        for(int t=0;t<T;t++){
            int n=Int();
            int m=Int();
            int k=Int();
            int A[][]=new int[n][m];

            for(int i=0;i<n;i++){
                for(int j=0;j<m;j++){
                    A[i][j]=Int();
                }
            }

            Solution sol=new Solution(out);
            sol.solution(A,k);
        }
        out.close();

    }




    public static int[] Arr(int n){
        int A[]=new int[n];
        for(int i=0;i<n;i++)A[i]=Int();
        return A;
    }
    public static int Int(){
        return fs.Int();
    }
    public static long Long(){
        return fs.Long();
    }
    public static String Str(){
        return fs.Str();
    }

}








class Solution {
    PrintWriter out;
    int INF = Integer.MAX_VALUE;
    int MOD = 1000000007;
    long mod = 1618964990108856391L;
    public Solution(PrintWriter out) {
        this.out = out;
    }



    public void solution(int A[][],int k) {
        int n =A.length,m=A[0].length;
        Seg segs[]=new Seg[m];
        Arrays.setAll(segs,e->new Seg(0,n-1));

        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                segs[j].update(i,A[i][j]);
            }
        }

        int mx = 0;
        int l=-1,r=-1;

        for(int i =0,j=0;i<n;i++){
            while(j<=i&&get(segs,j,i)>k){
                j++;
            }

            if(i>=j){
                int len = i-j+1;
                if(len>mx){
                    mx=len;
                    l=j;r=i;
                }
            }
        }

        if(mx==0){
            for(int i=0;i<m;i++){
                out.print(0+" ");
            }
        }
        else{
            for(int i=0;i<m;i++){
                out.print(segs[i].query(l,r)+" ");
            }
        }
    }

    public int get(Seg segs[],int l,int r){
        int sum = 0;
        for(int i=0;i<segs.length;i++){
            sum+=segs[i].query(l,r);
        }
        return sum;
    }

    class Seg{
        int l,r;
        int max=0;
        Seg left=null,right=null;
        public Seg(int l,int r){
            this.l=l;
            this.r=r;
            if(l!=r){
                int mid=l+(r-l)/2;
                if(l<=mid)left=new Seg(l,mid);
                if(r>=mid+1)right=new Seg(mid+1,r);
                if(left!=null)this.max=Math.max(max,left.max);
                if(right!=null)this.max=Math.max(max,right.max);
            }else{

            }
        }
        public int query(int s,int e){
            if(l==s&&r==e){
                return max;
            }
            int mid=l+(r-l)/2; //left :  to mid-1,
            if(e<=mid){
                return left.query(s,e);
            }
            else if(s>=mid+1){
                return right.query(s,e);
            }else{
                return Math.max(left.query(s,mid),right.query(mid+1,e));
            }
        }

        public void update(int index,int val){
            if(l==r){
                max+=val;
                return;
            }
            int mid=l+(r-l)/2;
            if(index<=mid){
                left.update(index,val);
            }else{
                right.update(index,val);
            }
            this.max=Math.max(left.max,right.max);
        }
    }

}
