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.
/*
 * Ossama told me that it wasn't the segment tree that failed me, it was him
 */

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main
{

	public static void main(String[] args) throws IOException
	{
		Main main = new Main();
		main.read();
	}

	/* IO */
	private StringBuilder ans;
	private BufferedReader in;
	private StringTokenizer tok;

	/* fields */
	private int nDroids;
	private int nTypes;
	private int nMaxShots;
	private int[][] type;
	private Node[] roots;

	private void read() throws IOException
	{
		// streams
		boolean file = false;
		if (file)
			in = new BufferedReader(new FileReader("input.txt"));
		else
			in = new BufferedReader(new InputStreamReader(System.in));
		ans = new StringBuilder();

		// read input
		tok = new StringTokenizer(in.readLine());
		nDroids = Integer.parseInt(tok.nextToken());
		nTypes = Integer.parseInt(tok.nextToken());
		nMaxShots = Integer.parseInt(tok.nextToken());
		type = new int[nDroids][nTypes];
		for (int i = 0; i < nDroids; i++)
		{
			tok = new StringTokenizer(in.readLine());
			for (int j = 0; j < nTypes; j++)
				type[i][j] = Integer.parseInt(tok.nextToken());
		}

		// solve
		System.out.println(solve());
	}

	private String solve()
	{
		makeSegmentTrees();

		// bs for the answer
		int start = 0;
		int end = nDroids + 1;

		while (end - start > 1)
		{
			int mid = (start + end) / 2;
			Status statusMid = isValid(mid);
			if (!statusMid.valid)
				end = mid;
			else
				start = mid;

		}

		Status Final = isValid(start);
		StringBuilder strb = new StringBuilder();
		for (int i = 0; i < nTypes; i++)
			strb.append(Final.count[i] + " ");
		return strb.toString().trim();
	}

	private Status isValid(int segmentLength)
	{
		Status status = new Status();
		status.valid = false;
		status.count = new int[5];

		// keep checking if we can get that segment
		for (int start = 0; start + segmentLength - 1 < nDroids; start++)
		{
			// find max number of details in droids
			int max[] = new int[nTypes];
			Arrays.fill(max, 0);
			int end = start + segmentLength - 1;
			for (int i = 0; i < nTypes; i++)
				max[i] = getMax(start, end, roots[i]);

			// find their sum
			int sum = 0;
			for (int i = 0; i < nTypes; i++)
				sum += max[i];
			if (sum <= nMaxShots)
			{
				status.valid = true;
				status.count = new int[nTypes];
				for (int i = 0; i < nTypes; i++)
					status.count[i] = max[i];
				status.start = start;
				status.end = end;
				return status;
			}
		}

		return status;
	}

	private void makeSegmentTrees()
	{
		roots = new Node[nTypes];
		for (int i = 0; i < nTypes; i++)
			roots[i] = makeNode(0, nDroids - 1, i);
	}

	private Node makeNode(int l, int r, int typeIdx)
	{
		// base case
		if (l == r)
		{
			Node leaf = new Node();
			leaf.l = l;
			leaf.r = r;
			leaf.val = type[l][typeIdx];
			return leaf;
		}

		// make left and right
		int mid = (l + r) / 2;
		Node left = makeNode(l, mid, typeIdx);
		Node right = makeNode(mid + 1, r, typeIdx);
		Node node = new Node();
		node.l = l;
		node.r = r;
		node.right = right;
		node.left = left;
		node.val = Math.max(right.val, left.val);
		return node;
	}

	int getMax(int l, int r, Node node)
	{
		if (node.r < l || node.l > r)
			return 0;
		else if (node.l >= l && node.r <= r)
			return node.val;
		else
			return Math.max(getMax(l, r, node.left), getMax(l, r, node.right));
	}
}

class Node
{
	int l, r;
	Node left, right;
	int val;

}

class Status
{
	boolean valid;
	int[] count;
	int start;
	int end;
}