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

public class Solve5 {

    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(System.out);
        new Solve5().solve(pw);
        pw.flush();
        pw.close();
    }

    public void solve(PrintWriter pw) throws IOException {
        FastReader sc = new FastReader();
        n = sc.nextInt();
        m = sc.nextInt();
        k = sc.nextInt();
        st = new SegmentTree[m];
        a = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = sc.nextInt();
            }
        }
        for (int i = 0; i < m; i++) {
            long[] b = new long[n];
            for (int j = 0; j < n; j++) {
                b[j] = a[j][i];
            }
            st[i] = new SegmentTree(n, b);
        }
        int ans = 0;
        int sp = 0, ep = 0;
        int l = 0, h = n;
        while (l <= h) {
            int mid = (l + h) >> 1;
            boolean f = true;
            for (int i = 0; i + mid - 1 < n; i++) {
                if (check(mid, i + 1)) {
                    if (mid > ans) {
                        sp = i + 1;
                        ep = i + mid;
                        ans = mid;
                    }
                    l = mid + 1;
                    f = false;
                    break;
                }
            }
            if (f) {
                h = mid - 1;
            }
        }
        for (int i = 0; i < m; i++) {
            pw.print(ans > 0 ? st[i].query(sp, ep).val : 0);
            pw.print(i + 1 == m ? "\n" : " ");
        }
    }
    int n, m, k;
    long[][] a;
    SegmentTree[] st;

    public boolean check(int mid, int start) {
        long s = 0;
        for (int i = 0; i < m; i++) {
            s += st[i].query(start, start + mid - 1).val;
        }
        return s <= k;
    }

    class SegmentTree {

        Node[] st;

        public SegmentTree(int n, long[] a) {
            st = new Node[n << 2];
            build(1, 1, n, a);
        }

        public void build(int nd, int left, int right, long[] a) {
            if (left == right) {
                //0-indexed or 1-indexed array
                st[nd] = new Node(a[left - 1]);
                return;
            }
            int mid = (left + right) >> 1;
            build(nd << 1, left, mid, a);
            build(nd << 1 | 1, mid + 1, right, a);
            st[nd] = operation(st[nd << 1], st[nd << 1 | 1]);
        }

        public Node operation(Node child1, Node child2) {
            //operation type
            return new Node(Math.max(child1.val, child2.val));
        }

        public void update(int index, long val) {
            update(1, 1, st.length >> 2, index, val);
        }

        public void update(int nd, int left, int right, int index, long val) {
            if (left == right) {
                //update
                st[nd] = new Node(val);
                return;
            }
            int mid = (left + right) >> 1;
            if (index <= mid) {
                update(nd << 1, left, mid, index, val);
            } else {
                update(nd << 1 | 1, mid + 1, right, index, val);
            }
            st[nd] = operation(st[nd << 1], st[nd << 1 | 1]);
        }

        public Node query(int l, int r) {
            return query(1, 1, st.length >> 2, l, r);
        }

        public Node query(int nd, int left, int right, int l, int r) {
            if (l <= left && right <= r) {
                return st[nd];
            }
            if (left > r || right < l) {
                //return value if not in segment
                return new Node(Long.MIN_VALUE);
            }
            int mid = (left + right) >> 1;
            Node x = query(nd << 1, left, mid, l, r);
            Node y = query(nd << 1 | 1, mid + 1, right, l, r);
            return operation(x, y);
        }

        public int binarySearch(long pos) {
            return binarySearch(1, 1, st.length >> 2, pos);
        }

        public int binarySearch(int nd, int left, int right, long pos) {
            if (left == right) {
                return left;
            }
            int mid = (left + right) >> 1;
            if (st[nd << 1].val >= pos) {
                return binarySearch(nd << 1, left, mid, pos);
            } else {
                return binarySearch(nd << 1 | 1, mid + 1, right, pos - st[nd << 1].val);
            }
        }

        class Node {

            long val;

            public Node(long val) {
                this.val = val;
            }
        }
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
            }
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                }
            }
            return st.nextToken();
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (Exception e) {
            }
            return null;
        }

        public boolean hasNext() throws IOException {
            if (st != null && st.hasMoreTokens()) {
                return true;
            }
            String s = br.readLine();
            if (s == null || s.isEmpty()) {
                return false;
            }
            st = new StringTokenizer(s);
            return true;
        }
    }
}
