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.*;
import java.lang.reflect.Array;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Created by gut on 14.02.15.
 */
public class D {
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException {
        int n = in.nextInt();
        int m = in.nextInt();
        int k = in.nextInt();

        Integer[][] d = new Integer[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                d[i][j] = in.nextInt();

        boolean[][] u = new boolean[m][n];
        int l = 0, r = n + 1, res = 0;
        while (l < r - 1) {
            res = (l + r) / 2;

            boolean can = false;

            for (int i = 0; i < m; i++)
                Arrays.fill(u[i], false);

            @SuppressWarnings("unchecked")
            ArrayList<ArrayDeque<Pair>> deque = new ArrayList<ArrayDeque<Pair>>();
            for (int j = 0; j < m; j++)
                deque.add(new ArrayDeque<Pair>());
            for (int i = 0; i < res - 1; i++) {
                for (int j = 0; j < m; j++) {
                    add(u[j], deque.get(j), new Pair(d[i][j], i));
                }
            }

            for (int i = res - 1; i < n; i++) {
                for (int j = 0; j < m; j++)
                    add(u[j], deque.get(j), new Pair(d[i][j], i));
                int sum = 0;
                for (int j = 0; j < m; j++)
                    sum += getMax(deque.get(j));
                if (sum <= k) {
                    can = true;
                    break;
                }
                for (int j = 0; j < m; j++)
                    pop(u[j], deque.get(j), i - res + 1);
            }
            if (can)
                l = res;
            else
                r = res;
        }

        res = l;

        if (res == 0) {
            for (int j = 0; j < m; j++)
                out.print("0 ");
            return;
        }

        for (int i = 0; i < m; i++)
            Arrays.fill(u[i], false);
        @SuppressWarnings("unchecked")
        ArrayList<ArrayDeque<Pair>> deque = new ArrayList<ArrayDeque<Pair>>();
        for (int j = 0; j < m; j++)
            deque.add(new ArrayDeque<Pair>());
        for (int i = 0; i < res - 1; i++) {
            for (int j = 0; j < m; j++) {
                add(u[j], deque.get(j), new Pair(d[i][j], i));
            }
        }

        for (int i = res - 1; i < n; i++) {
            for (int j = 0; j < m; j++)
                add(u[j], deque.get(j), new Pair(d[i][j], i));
            int sum = 0;
            for (int j = 0; j < m; j++)
                sum += getMax(deque.get(j));
            if (sum <= k) {
                for (int j = 0; j < m; j++) {
                    out.print(getMax(deque.get(j)));
                    out.print(' ');
                }
                return;
            }
            for (int j = 0; j < m; j++)
                pop(u[j], deque.get(j), i - res + 1);
        }
    }

    public void add(boolean[] u, ArrayDeque<Pair> deque, Pair value) {
        while (!deque.isEmpty() && deque.getLast().x < value.x) {
            Pair curLast = deque.pollLast();
            u[curLast.num] = true;
        }
        deque.addLast(value);
    }

    public int getMax(ArrayDeque<Pair> deque) {
        if (!deque.isEmpty())
            return deque.getFirst().x;
        return 0;
    }

    public void pop(boolean[] u, ArrayDeque<Pair> deque, int num) {
        if (!u[num])
            deque.pollFirst();
    }

    class Pair {
        public Integer x;
        public int num;

        Pair(Integer xn, int cnum) {
            x = xn;
            num = cnum;
        }
    }

    public void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new D().run();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() {
            try {
                while (st == null || !st.hasMoreTokens())
                    st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }
}
