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.util.*;
import java.io.*;
import java.math.*;
@SuppressWarnings("unchecked")
public class Main {
    InputReader ir = new InputReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n;
    int m;
    int k;
    Deque <Integer> q[];
    int arr[][];
    boolean check(int h) {
        q = new ArrayDeque[m];
        for(int i = 0; i < m; i++)
            q[i] = new ArrayDeque();
        for(int i = 0; i < h; i++) {
            for(int j = 0; j < m; j++) {
                while(!q[j].isEmpty() && arr[i][j] >= arr[q[j].peekLast()][j])
                    q[j].removeLast();
                q[j].addLast(i);
            }
        }
        
            int tot = 0;
            for(int i = h; i < n; i++) {
                tot = 0;
               
                for(int j = 0; j < m; j++)
                    tot += arr[q[j].peek()][j];
                if(tot <= k)
                    return true;
                for(int j = 0; j < m; j++)
                    while(!q[j].isEmpty() && q[j].peekFirst() <= i - h)
                        q[j].removeFirst();
                for(int j = 0; j < m; j++) {
                    while(!q[j].isEmpty() && arr[i][j] >= arr[q[j].peekLast()][j])
                        q[j].removeLast();
                    q[j].addLast(i);
                }

            }
            tot = 0;
            
            for(int j = 0; j < m; j++)
                    tot += arr[q[j].peek()][j];
                if(tot <= k)
                    return true;
            return false;
        
        
    }
    void solve() {
        n = ir.readInt();
        m = ir.readInt();
        k = ir.readInt();
        //Deque <Integer> q = new ArrayDeque();
        arr = new int[n][m];
        for(int i = 0; i < n; i++)
            for(int j = 0; j < m; j++)
                arr[i][j] = ir.readInt();
        int s = 1;
        int e = n;
        
       while(s + 1 < e) {
            int mid = (s + e)/2;
            if(check(mid)) {
                s = mid;
            } else {
                e = mid - 1;
            }
        }
        for(int i = e; i >= s; i--) {
            if(check(i)) {
                for(int j = 0;j < m; j++) {
                    out.print(arr[q[j].peek()][j] + " ");
                }
                return;
            }
        }

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

    void run() {
        solve();
        out.close();
    }

    public static void main(String args[]){
        new Main().run();
    }
}
class Node implements Comparable <Node>{
    int val;
    int x;
    int y;
    public Node(int v, int m, int n) {
        val = v;
        x = m;
        y = n;
    }

    @Override
    public int compareTo(Node o) {
        if(o.val != val)
            return o.val - val;
        if(o.x != x)
            return o.x - x;
        return o.y - y;
    }
}


class InputReader {
 
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;
 
    public InputReader(InputStream stream) {
        this.stream = stream;
    }
 
    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }
    public final int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
    }
    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }
 
    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }
        public double readDouble() {
        return Double.parseDouble(readString());
    }
 
    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public String next() {
        return readString();
    }
 
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}
class ArrayUtil {
    static int lowerbs(int arr[], int start, int end, int key) {
        if(start + 1 < end) {
            int mid = start + (end - start)/2;
            if(arr[mid] <= key) {
                return lowerbs(arr, mid, end, key);
            } else {
                return lowerbs(arr, start, mid - 1, key);
            }
        } else {
            int idx = -1;
            for(int i = start; i <= end; i++) {
                if(arr[i] <= key) {
                    idx = i;
                }
            }
            return idx;
        }
    }
    static int upperbs(int arr[], int start, int end, int key) {
        if(start + 1 < end) {
            int mid = start + (end - start)/2;
            if(arr[mid] >= key) {
                return upperbs(arr, start, mid, key);
            } else {
                return upperbs(arr, mid + 1, end, key);
            }
        } else {
            int idx = -1;
            for(int i = start; i <= end; i++) {
                if(arr[i] >= key) {
                    idx = i;
                    break;
                }
            }
            return idx;
        }
    }
}
class Pair <Type1 extends Comparable<Type1>, Type2 extends Comparable<Type2>> implements Comparable <Pair<Type1, Type2>>{
    Type1 first;
    Type2 second;
    public Pair(Type1 F, Type2 S) {
        this.first = F;
        this.second = S;
    }
    @Override 
    public int compareTo(Pair <Type1, Type2> p) {
        if(first.compareTo(p.first) == 0)
            return second.compareTo(p.second);
        return first.compareTo(p.first);
    }
}