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.
/*
 * Each segment tree coded in the universe brings warmth to Ahmed Ossama's cold heart
 */

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.invoke.ConstantCallSite;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.RecursiveAction;

public class Main
{

    public static void main(String[] args) throws IOException
    {
        Main main = new Main();
        main.read();
    }

    /* IO */
    private StringBuilder ans;
    private BufferedReader in;
    private StringTokenizer tok;
    private int[][] tree;
    /* fields */
    private int nDroids;
    private int nTypes;
    private int nMaxShots;
    private int[][] type;
    //private Node[] roots;
    

    private void read() throws IOException
    {
        // streams
        boolean file = false;
        if (file)
            in = new BufferedReader(new FileReader("input.txt"));
        else
            in = new BufferedReader(new InputStreamReader(System.in));
        ans = new StringBuilder();

        // read input
        tok = new StringTokenizer(in.readLine());
        nDroids = Integer.parseInt(tok.nextToken());
        nTypes = Integer.parseInt(tok.nextToken());
        nMaxShots = Integer.parseInt(tok.nextToken());
        type = new int[nDroids][nTypes];
        for (int i = 0; i < nDroids; i++)
        {
            tok = new StringTokenizer(in.readLine());
            for (int j = 0; j < nTypes; j++)
                type[i][j] = Integer.parseInt(tok.nextToken());
               // if(i==0)type[i][j] = 1;
               // else type[i][j] = 100000000;
        }

        // solve
        System.out.println(solve());
    }

    private String solve()
    {
        makeSegmentTrees();

        // bs for the answer
        int start = 0;
        int end = nDroids+1;
        
        while (end - start > 1)
        {
            int mid = (start + end) / 2;
            Status statusMid = isValid(mid);
            //Status statusNext = isValid(mid + 1);
            /*if (statusMid.valid && !statusNext.valid)
            {
                // return string
                StringBuilder strb = new StringBuilder();
                for (int i = 0; i < nTypes; i++)
                    strb.append(statusMid.count[i] + " ");
                return strb.toString().trim();
            } else */
            //System.out.println(mid);
            //System.out.println(statusMid.valid);
            if (!statusMid.valid)
                end = mid;
            else {
                start = mid;
            }
        }
       // System.out.println(end-1);
        Status Final = isValid(start);
      // System.out.println(Final.valid);
        // i failed :(
        StringBuilder strb = new StringBuilder();
        for (int i = 0; i < nTypes; i++)
            strb.append(Final.count[i] + " ");
        return strb.toString().trim();
    }

    private Status isValid(int segmentLength)
    {
        // keep checking if we can get that segment
        for (int start = 0; start + segmentLength - 1 < nDroids; start++)
        {
            // find max number of details in droids
            int max[] = new int[nTypes];
            Arrays.fill(max, 0);
            int end = start + segmentLength - 1;
            for (int i = 0; i < nTypes; i++)
                max[i] = getMax(start, end, 1, 0, nDroids-1, i);

            // find their sum
            int sum = 0;
            for (int i = 0; i < nTypes; i++)
                sum += max[i];
            if (sum <= nMaxShots)
            {
                Status ok = new Status();
                ok.valid = true;
                ok.count = new int[nTypes];
                for (int i = 0; i < nTypes; i++)
                    ok.count[i] = max[i];
                ok.start = start;
                ok.end = end;
                return ok;
            }
        }

        Status failed = new Status();
        failed.valid = false;
        return failed;
    }

    private void makeSegmentTrees()
    {
        tree = new int[4*nDroids][nTypes];
        for(int j = 0; j < nDroids; j++)
            for (int i = 0; i < nTypes; i++)        
                update(j, type[j][i], 1, 0, nDroids - 1, i);
    }

    private void update(int ind, int val, int node, int l, int r, int typeIdx)
    {
        if(ind<l || ind>r || r<l)
            return;
        // base case
        if (l == r)
        {
            tree[node][typeIdx] = val;
            return;
        }

        // make left and right
        int mid = (l + r) / 2;
        update(ind, val, node * 2, l, mid, typeIdx);
        update(ind, val, node * 2 + 1, mid+1, r, typeIdx);
        
        tree[node][typeIdx] = Math.max(tree[node*2][typeIdx], tree[node*2+1][typeIdx]);
        return;
    }

    int getMax(int l, int r, int node, int left, int right, int typeIdx)
    {
        if (r < left || l > right || right<left || r<l)
            return 0;
        else if (left >= l && right <= r)
            return tree[node][typeIdx];
        else {
        int mid = (left+right)/2;
            return Math.max(getMax(l, r, node*2,left,mid,typeIdx), getMax(l, r, node*2+1,mid+1,right,typeIdx));
            }
    }
}



class Status
{
    boolean valid;
    int[] count;
    int start;
    int end;
}