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.
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
/**
 *
 * @author fz
 */
public class CF_rnd291D {
    Scanner in = new Scanner(System.in);

    private CF_rnd291D() throws IOException {
        //in.nextLine();
        int n = in.nextInt();
        int m = in.nextInt();
        int k = in.nextInt();
        int[][] mat = new int[m][n];
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                mat[j][i] = in.nextInt();
            }
        }
        int num = (int) Math.ceil(Math.log((double) n) / Math.log(2));
        int[][] segs = new int[m][1 << num + 1];
        for(int i = 0; i < m; i++) {
            constructSTUtil(mat[i], 0, mat[i].length - 1, segs[i], 0);
        }
        
        int l = 0;
        int r = 0;
        int best_len = 0;
        int[] res = new int[m];
        while(l < n) {
            while(r < n) {
                int val = getSum(segs, n, l, r);
                if(val <= k) {
                    r++;
                }
                else
                    break;
            }
            int cur_len = r - l;
            if(cur_len > best_len) {
                best_len = cur_len;
                for(int j = 0; j < m; j++) {
                    res[j] = RMQ(segs[j], n, l, r - 1);
                }
            }
            l++;
        }
        for(int j = 0; j < m; j++)
            System.out.println(res[j] + " ");

    }
    public int getSum(int[][] segs, int n, int l, int r){
        int sum = 0;
        for(int j = 0; j < segs.length; j++) {
            sum += RMQ(segs[j], n, l, r);
        }
        return sum;
    }
    
    public boolean check(int mid, int[][] segs, int n, int k) {
        //int len = segs[0].length;
        for(int i = 0; i <= n - mid; i++) {
            int sum = 0;
            for(int j = 0; j < segs.length; j++) {
                sum += RMQ(segs[j], n, i, i + mid - 1);
            }
            if(sum <= k) {
                return true;
            }
        }
        return false;
    }
    
    
    
    public int RMQUtil(int[] st, int ss, int se, int qs, int qe, int index) {
        if(qs <= ss && qe >= se)
            return st[index];
        if(se < qs || ss > qe)
            return Integer.MIN_VALUE; //change min to cumstomize
        int mid = (ss + se) / 2;
        int v1 = RMQUtil(st, ss, mid, qs, qe, 2 * index + 1);
        int v2 = RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2);
        return Math.max(v1, v2); //change min to cumstomize
        
    }
    public int RMQ(int[] st, int n, int qs, int qe) {
        if(qs < 0 || qe > st.length - 1 || qs > qe) {
            //System.out.println("Error query");
            return 0;
        }
        return RMQUtil(st, 0, n - 1, qs, qe, 0);
    }
    public int constructSTUtil(int[] arr, int ss, int se, int[] st, int si) {
        if(ss == se) {
            st[si] = arr[ss];
            return arr[ss];
        }
        int mid = (ss + se) / 2;
        int v1 = constructSTUtil(arr, ss, mid, st, 2 * si + 1);
        int v2 = constructSTUtil(arr, mid + 1, se, st, 2 * si + 2);
        st[si] = Math.max(v1, v2); //change min to cumstomize
        return st[si];
    }
    
    

    
    private int[] ns(int n) {
        int[] res = new int[n];
        for(int i = 0; i < n; i++) {
            res[i] = in.nextInt();
        }
        return res;
    }
    private int[][] getMat(int m, int n) {//m rows and n cols
        int[][] res = new int[m][n];
        for(int i = 0; i < m; i++)
            for(int j = 0; j < n; j++)
                res[i][j] = in.nextInt();
        return res;
    }
    private static void out(Object x) {
        System.out.println(x);
    }
    public static void main(String[] args) throws IOException {
        new CF_rnd291D();
    }
}
