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.*;

public class Main {
	
	static class Assert {
		
		static void check(boolean e) {
			if (!e) {
				throw new Error();
			}
		}
	}
	
	static class Scanner {
		
		StreamTokenizer in;
		
		Scanner(Reader r) {
			in = new StreamTokenizer(new BufferedReader(r));
			in.resetSyntax();
			in.whitespaceChars(0, 32);
			in.wordChars(33, 255);
		}
		
		String next() {
			try {
				in.nextToken();
				Assert.check(in.ttype == in.TT_WORD);
				return in.sval;
			} catch (IOException e) {
				throw new Error(e);
			}
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) throws IOException {
            br = new BufferedReader(new InputStreamReader(in));
        }

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

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

        long nextLong() {
            return Long.parseLong(next());
        }
		
	double nextDouble() {
		return Double.parseDouble(next());
	}
    }
	
	//FastScanner in;
	
	//Scanner in;

	PrintWriter out;
	
	final int INF = (int)1e9;
	
	class SegmentTree {
		
		private int size;
		private int[] tree;
		
		public SegmentTree(int _size) {
			size = _size;
			tree = new int[4 * size];
		}
		
		public void buildTree(int[] array, int v, int left, int right) {
			if (left == right) {
				tree[v] = array[left];
			} else {
				int middle = (left + right) / 2;
				buildTree(array, v * 2, left, middle);
				buildTree(array, v * 2 + 1, middle + 1, right);
				tree[v] = Math.max(tree[v * 2], tree[v * 2 + 1]);
			}
		}
		
		public int getMax(int v, int left, int right, int leftQuery, int rightQuery) {
			if (leftQuery > rightQuery) {
				return 0;
			}
			if (left == leftQuery && right == rightQuery) {
				return tree[v];
			}
			int middle = (left + right) / 2;
			return Math.max(getMax(v * 2, left, middle, leftQuery, Math.min(middle, rightQuery)), 
					getMax(v * 2 + 1, middle + 1, right, Math.max(leftQuery, middle + 1), rightQuery));
		}
	}
	
	class FastReader extends BufferedReader {

	    public FastReader(InputStream is) {
	        super(new InputStreamReader(is));
	    }

	    public int read() {
	        try {
	            int ret = super.read();
//	            if (isEOF && ret < 0) {
//	                throw new InputMismatchException();
//	            }
//	            isEOF = ret == -1;
	            return ret;
	        } catch (IOException e) {
	            throw new InputMismatchException();
	        }
	    }

	    boolean isWhiteSpace(int c) {
	        return c >= 0 && c <= 32;
	    }

	    public int nextInt() {
	        int c = read();
	        while (isWhiteSpace(c)) {
	            c = read();
	        }
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = read();
	        }
	        int ret = 0;
	        while (c >= 0 && !isWhiteSpace(c)) {
	            if (c < '0' || c > '9') {
	                throw new NumberFormatException("digit expected " + (char) c
	                        + " found");
	            }
	            ret = ret * 10 + c - '0';
	            c = read();
	        }
	        return ret * sgn;
	    }

	    public String readLine() {
	        try {
	            return super.readLine();
	        } catch (IOException e) {
	            return null;
	        }
	    }

	}

	
	void solve() throws IOException {
		FastScanner in = new FastScanner(System.in);
		int n = in.nextInt(), m = in.nextInt(), k = in.nextInt();
		int[][] details = new int[m][n];
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				details[j][i] = in.nextInt();
			}
		}
		SegmentTree[] trees = new SegmentTree[m];
		for (int i = 0; i < m; ++i) {
			trees[i] = new SegmentTree(n);
			trees[i].buildTree(details[i], 1, 0, n - 1);
		}
		int left = 0, right = n + 1;
		while (right - left > 1) {
			int middle = (left + right) / 2;
			boolean f = false;
			for (int i = 0; i + middle - 1 < n; ++i) {
				int res = 0;
				for (int j = 0; j < m; ++j) {
					res += trees[j].getMax(1, 0, n - 1, i, i + middle - 1);
				}
				if (res <= k) {
					f = true;
					break;
				}
			}
			if (f) {
				left = middle;
			} else {
				right = middle;
			}
		}
		int[] ans = new int[m];
		for (int i = 0; i + left - 1 < n; ++i) {
			int res = 0;
			int[] curr = new int[m];
			for (int j = 0; j < m; ++j) {
				curr[j] = trees[j].getMax(1, 0, n - 1, i, i + left - 1);
				res += curr[j];
			}
			if (res <= k) {
				ans = curr;
			}
		}
		for (int i = 0; i < ans.length; ++i) {
			out.print(ans[i] + " ");
		}
		out.println();
	}
	
	void run() throws IOException {
		//in = new FastScanner(System.in);
		out = new PrintWriter(System.out);
		//in = new Scanner(new FileReader("input.txt"));
		//out = new PrintWriter(new FileWriter("output.txt"));
		try {
			solve();
		} finally {
			out.close();
		}
	}
	
	public static void main(String args[]) throws IOException {
		new Main().run();
	}
}