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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class a {
	public static class node {
		int node;
		int val;
		int idx;

		node(int index, int val, int r) {
			node = index;
			this.val = val;
			idx = r;
		}

	}

	public static class point implements Comparable<point> {
		int x;
		long val;

		point(int x, long val) {
			this.x = x;
			this.val = val;
		}

		public int compareTo(point o) {
			if (o.val < val)
				return 1;
			else if (o.val > val)
				return -1;

			return 0;
		}

	}

	public static long gcd(long a, long b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	public static ArrayList<Integer> prime;

	public static void sieve(int n) {
		boolean vis[] = new boolean[n + 5];
		vis[1] = true;
		vis[0] = true;
		for (int i = 2; i <= n; i++) {
			if (!vis[i]) {
				prime.add(i);
				for (long j = (long) i * (long) i; j <= n; j += i) {
					vis[(int) j] = true;
				}
			}
		}
	}

	public static int tree[][];
	public static boolean end[][];
	public static int counter;

	public static void trie(String a) {
		int st = 0;

		for (int i = 0; i < a.length(); i++) {
			if (tree[a.charAt(i) - 'a'][st] == 0) {
				tree[a.charAt(i) - 'a'][st] = counter++;
			}

			st = tree[a.charAt(i) - 'a'][st];
		}
		end[a.charAt(a.length() - 1) - 'a'][st] = true;

	}

	public static int seg[][];
	public static int a[][];
	public static int m;

	public static void build(int s, int e, int p) {
		if (s == e) {
			for (int i = 0; i < m; i++) {
				//System.out.println(p+" "+s);
				seg[i][p] = a[i][s];
			}
			return;
		}
		int mid = (s + e) / 2;
		build(s, mid, p * 2);
		build(mid + 1, e, p * 2 + 1);
		for (int i = 0; i < m; i++) {
			seg[i][p] = Math.max(seg[i][p * 2], seg[i][p * 2 + 1]);
		}
	}

	public static int get(int s, int e, int p, int from, int to, int seg[]) {
		if (s >= from && e <= to)
			return seg[p];
		if (s > to || e < from)
			return 0;
		int mid = (s + e) / 2;
		int one = get(s, mid, p * 2, from, to, seg);
		int two = get(mid + 1, e, p * 2 + 1, from, to, seg);
		return Math.max(one, two);
	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new FileReader(
		// "B-small-attempt0.in"));

		StringBuilder q = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		// PrintWriter out = new PrintWriter(new FileWriter("out.txt"));
		String y[] = in.readLine().split(" ");
		int n = Integer.parseInt(y[0]);
		m = Integer.parseInt(y[1]);
		int k = Integer.parseInt(y[2]);
		a = new int[m][n+1];
		seg = new int[m][n * 4 + 10];
		for (int i = 1; i <= n; i++) {
			y = in.readLine().split(" ");
			for (int j = 0; j < m; j++) {
				a[j][i] = Integer.parseInt(y[j]);
			}
		}
		build(1, n, 1);
		int p1 = 1;
		int p2 = 1;
		int max = 0;
		int ans[] = new int[m];
		while (p1 <= n && p2 <= n) {
			int temp[] = new int[m];
			long sum = 0;
			for (int i = 0; i < m; i++) {
				temp[i] = get(1, n, 1, p1, p2, seg[i]);
				sum += temp[i];
			}
			
			if (sum <= k) {
				p2++;
				if (max < p2 - p1 + 1) {
					max = p2 - p1 + 1;
					for (int i = 0; i < m; i++) {
						ans[i] = temp[i];
					}
				}
			} else {
				p1++;
			}

		}
		
		for (int i = 0; i < m; i++) {
			q.append(ans[i]+" ");
		}
		System.out.println(q);

		out.close();
	}
}