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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.ni();
            int m = in.ni();
            long k = in.ni();
            int[][] ar = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    ar[i][j] = in.ni();
                }
            }

            MaxQueue[] qs = new MaxQueue[m];
            for (int i = 0; i < m; i++) {
                qs[i] = new MaxQueue(n);
            }

            int[] shoots = new int[m];
            int best = 0;
            int start = 0, end = 0;
            outer:
            for (start = 0; start < n && end < n; ) {
                if (sum(ar[start]) > k) {
                    start++;
                    continue outer;
                }

                for (int i = 0; i < m; i++) {
                    qs[i].enq(ar[start][i]);
                }

                if (best < end - start + 1) {
                    for (int i = 0; i < m; i++) {
                        shoots[i] = qs[i].max();
                    }
                    best = end - start + 1;
                }

                for (end = start + 1; end < n; end++) {
                    for (int i = 0; i < m; i++) {
                        qs[i].enq(ar[end][i]);
                    }

                    while (start <= end && sum(qs) > k) {
                        for (int i = 0; i < m; i++) {
                            qs[i].deq();
                        }
                        start++;
                    }
                    if (start > end)
                        continue outer;

                    if (best < end - start + 1) {
                        for (int i = 0; i < m; i++) {
                            shoots[i] = qs[i].max();
                        }
                        best = end - start + 1;
                    }
                }
            }

            for (int i = 0; i < shoots.length; i++) {
                out.print(shoots[i] + " ");
            }
            out.println();
        }

        static long sum(int[] ar) {
            long s = 0;
            for (int i = 0; i < ar.length; i++) {
                s += ar[i];
            }
            return s;
        }

        static long sum(MaxQueue[] pqs) {
            long s = 0;
            for (int i = 0; i < pqs.length; i++) {
                s += pqs[i].max();
            }
            return s;
        }

        class MaxQueue {
            int[] inFirst;
            int[] inSecond;
            int[] outFirst;
            int[] outSecond;
            int spIn;
            int spOut;

            public MaxQueue(int capacity) {
                inFirst = new int[capacity];
                inSecond = new int[capacity];
                outFirst = new int[capacity];
                outSecond = new int[capacity];
            }

            public void enq(int v) {
                if (spIn == 0) {
                    inFirst[spIn] = v;
                    inSecond[spIn] = v;
                } else {
                    inFirst[spIn] = v;
                    inSecond[spIn] = Math.max(inSecond[spIn - 1], v);
                }
                spIn++;
            }

            public void deq() {
                if (spOut > 0) {
                    --spOut;
                } else if (spIn > 0) {
                    while (spIn > 0) {
                        int top = inFirst[spIn - 1];
                        int max = top;
                        if (spOut > 0) {
                            max = Math.max(outSecond[spOut - 1], max);
                        }
                        outFirst[spOut] = top;
                        outSecond[spOut] = max;
                        spOut++;
                        --spIn;
                    }
                    --spOut;
                } else {
                    assert false;
                }
            }

            public int max() {
                if (spIn > 0 && spOut > 0)
                    return Math.max(inSecond[spIn - 1], outSecond[spOut - 1]);
                if (spIn > 0)
                    return inSecond[spIn - 1];
                if (spOut > 0)
                    return outSecond[spOut - 1];

                assert false;
                return 0;
            }

        }

    }

    static class InputReader {
        StringTokenizer st;
        BufferedReader br;

        public InputReader(InputStream is) {
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            this.br = br;
        }

        public String n() {
            if (st == null || !st.hasMoreTokens()) {
                String nextLine = null;
                try {
                    nextLine = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (nextLine == null)
                    return null;
                st = new StringTokenizer(nextLine);
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(n());
        }

    }
}

