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.util.*;
import static java.lang.Math.*;

public class SolveContest {
    private BufferedReader in;
    private PrintWriter out;

    public SolveContest() {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter(new FileWriter("output.txt"),true);
            solve();
        } catch (Exception e) {
            e.printStackTrace();
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
        } finally {
            try {
                in.close();
            } catch (IOException e) {

            }
            out.close();
        }
    }
    StringTokenizer st;
    String nextToken() {
        while (st == null || !st.hasMoreTokens())
            try {
                st = new StringTokenizer(in.readLine());
            } catch (IOException e) {

            }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.valueOf(nextToken());
    }
    long nextLong() {
        return Long.valueOf(nextToken());
    }


    public void solve() {
        int n = nextInt();
        int m = nextInt();
        int k = nextInt();
        OptQueue[] oq = new OptQueue[m];
        for (int i = 0; i < m; i++) {
            oq[i] = new OptQueue();
        }
        int[][] a = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = nextInt();
            }
        }
        int ans = 0;
        String sans = "";
        int lf = 0;
        for (int i = 0; i < n+1; i++) {
            long max = 0;
            for (int j = 0; j < m; j++) {
                max += oq[j].getMax();
            }
            while (k < max && lf <= i) {
                for (int j = 0; j < m; j++) {
                    oq[j].pop();
                }
                max = 0;
                for (int j = 0; j < m; j++) {
                    max += oq[j].getMax();
                }
                lf++;
            }
            if (ans < i - lf) {
                ans = i - lf;
                sans = "";
                for (int j = 0; j < m; j++) {
                    sans += oq[j].getMax() + " ";
                }
            }
            if (i == n) continue;
            for (int j = 0; j < m; j++) {
                oq[j].push(new Pair(a[i][j], a[i][j]));
            }
        }
        if (sans.equals("")) {
            for (int i = 0; i < m; i++) {
                out.print("0");
                out.print(" ");
            }
        } else
            out.print(sans);
    }

    public static void main(String[] args) {
        new SolveContest();
    }

    private long sqr(long a) {return 1L*a*a;}
    long pow(long a, long b) {
        if (b == 0) return 1;
        if (b % 2 == 0) {
            long c = pow(a, b/2);
            return c*c;
        } else {
            return a*pow(a,b-1);
        }
    }
}

class OptQueue {
    OptStack s1 = new OptStack();
    OptStack s2 = new OptStack();

    void push(Pair a) {
        if (s1.isEmpty()) {
            s1.push(a);
        } else {
            long max = max(a.a, s1.peek().b);
            s1.push(new Pair(a.a,max));
        }
    }

    Pair pop() {
        if (s2.isEmpty()) {
            while (!s1.isEmpty()) {
                Pair a = s1.pop();
                s2.push(s2.isEmpty() ? new Pair(a.a, a.a) : new Pair(a.a, max(s2.peek().b, a.a)));
            }
        }
        return s2.pop();
    }

    long getMax() {
        if (s1.isEmpty() && s2.isEmpty()) return 0;
        if (s1.isEmpty())
            return s2.peek().b;
        if (s2.isEmpty())
            return s1.peek().b;
        else
            return max(s1.peek().b, s2.peek().b);
    }

}

class Pair {
    long a,b;

    public Pair(long a, long b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public String toString() {
        return a + " " + b;
    }
}

class OptStack {
    Stack<Pair> stack = new Stack<Pair>();

    void push(Pair a) {
        if (stack.isEmpty()) {
            stack.push(a);
        } else {
            long mx = max(a.a,stack.peek().b);
            stack.push(new Pair(a.a, mx));
        }
    }

    Pair pop() {
        if (!stack.isEmpty())
            return stack.pop();
        else
            return null;
    }

    boolean isEmpty() {
        return stack.isEmpty();
    }

    Pair peek() {
        if (!stack.isEmpty())
            return stack.peek();
        else
            return null;
    }

}