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

public class Main {

	BufferedReader in;
	StringTokenizer str = null;
	PrintWriter out;
	
	private String next() throws Exception{
		while (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}
	
	private int nextInt() throws Exception{
		return Integer.parseInt(next());
	}
	
	private long nextLong() throws Exception{
		return Long.parseLong(next());
	}
	
	private double nextDouble() throws Exception{
		return Double.parseDouble(next());
	}
	
	// SegmentTree []tree;

	public void run() throws Exception{
		in =  new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		int n = nextInt(), m = nextInt(), k = nextInt();
		int [][]a = new int[n][m];
		for(int i = 0; i < n; ++i) {
			for(int j = 0; j < m; ++j) {
				a[i][j] = nextInt();
			}
		}

		MyQueue []q = new MyQueue[m];
		for(int i = 0; i < m; ++i) {
			q[i] = new MyQueue();
			q[i].add(a[0][i]);
		}

		int ret = 0, lo = 0, hi = 0;
		int []r = new int[m];
		int []shots = new int[m];
		while(hi < n) {
			long s = 0;
			for(int i = 0; i < m; ++i) {
				shots[i] = q[i].max();
				s += shots[i];
			}

			// System.out.println(lo + " " + hi + " " + Arrays.toString(shots));

			if (s <= k) {
				if (ret < hi - lo + 1) {
					ret = hi - lo + 1;
					r = shots.clone();
				}
				++hi;
				if (hi < n) {
					for(int i = 0; i < m; ++i) {
						q[i].add(a[hi][i]);
					}	
				}
			}else {
				++lo;
				for(int i = 0; i < m; ++i) {
					q[i].poll();
				}
			}
		}
		// tree = new SegmentTree[m];
		// for(int i = 0; i < m; ++i) {
		// 	int []b = new int[n];
		// 	for(int j = 0; j < n; ++j) {
		// 		b[j] = a[j][i];
		// 	}
		// 	tree[i] = new SegmentTree(b);
		// }
		
		// int ret = 0, lo = 0, hi = 0;
		// int []r = new int[m];
		// int []shots = new int[m];
		// while(hi < n) {
		// 	long s = 0;
		// 	for(int i = 0; i < m; ++i) {
		// 		shots[i] = tree[i].query(lo, hi);
		// 		s += shots[i];
		// 	}
		// 	// System.out.println(lo + " " + hi + " " + Arrays.toString(shots));
		// 	if (s <= k) {
		// 		if (ret < hi - lo + 1) {
		// 			ret = hi - lo + 1;
		// 			r = shots.clone();
		// 		}
		// 		++hi;
		// 	}else {
		// 		++lo;
		// 		// if (lo > hi) ++hi;
		// 	}
		// }
		// out.println("len = " + ret);
		for(int i = 0; i < m; ++i) {
			out.print(r[i] + " ");
		}
		out.println();
		out.close();
	}

	class P {
		int a, b;
		public P(int a, int b) {
			this.a = a;
			this.b = b;
		}
	}

	class MyQueue {
		Stack<P> s1, s2;

		public MyQueue() {
			s1 = new Stack<P>();
			s2 = new Stack<P>();
		}

		public int max() {
			if (s1.size() == 0 || s2.size() == 0) {
				if (s1.size() == 0 && s2.size() == 0) return 0;
				if (s1.size() == 0) return s2.peek().b;
				return s1.peek().b;
			}
			return Math.max(s1.peek().b, s2.peek().b);
		}

		public void add(int x) {
			if (s1.size() == 0) {
				s1.add(new P(x, x));
			}else {
				P top = s1.peek();
				s1.add(new P(x, Math.max(x, top.b)));
			}
		}

		public void poll() {
			if (s2.size() == 0) {
				while(s1.size() > 0) {
					int max = -1;
					P top = s1.pop();
					if (s2.size() > 0) {
						max = Math.max(top.a, s2.peek().b);
					}else {
						max = top.a;
					}
					s2.add(new P(top.a, max));
				}
			}
			if (s2.size() == 0) return;
			s2.pop();
		}
	}

	// final static int oo = Integer.MAX_VALUE / 2;

	// class SegmentTree {
	// 	int []tree;
	// 	int n;
	// 	public SegmentTree(int []a) {
	// 		n = a.length;
	// 		int N = Integer.highestOneBit(n) << 2;
	// 		tree = new int[N];
	// 		build(1, 0, n - 1, a);
	// 	}

	// 	private void build(int v, int tl, int tr, int []a) {
	// 		if (tl == tr) {
	// 			tree[v] = a[tl];
	// 			return;
	// 		}
	// 		int tm = (tl + tr) >> 1;
	// 		build(2 * v, tl, tm, a);
	// 		build(2 * v + 1, tm + 1, tr, a);

	// 		tree[v] = Math.max(tree[2 * v], tree[2 * v + 1]);
	// 	}

	// 	public int query(int l, int r) {
	// 		return query(1, 0, n - 1, l, r);
	// 	}

	// 	private int query(int v, int tl, int tr, int l, int r) {
	// 		if (l > r) return 0;
	// 		if (tl == l && tr == r) {
	// 			return tree[v];
	// 		}
	// 		int tm = (tl + tr) >> 1;
	// 		int left = query(2 * v, tl, tm, l, Math.min(tm, r));
	// 		int right = query(2 * v + 1, tm + 1, tr, Math.max(l, tm + 1), r);

	// 		return Math.max(left, right);
	// 	}
	// }
		
	public static void main(String[] args) throws Exception{
		new Main().run();
	}
}
