human
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.
from  ... Can you provide a Python code to 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?
assistant
#Here is Python code to 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.
bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
 
# M = mod = 998244353
# def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
# def inv_mod(n):return pow(n, mod - 2, mod)
 
def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n').split(' ')]
def li3():return [int(i) for i in input().rstrip('\n')]

def givediff(a,b):
    return sum(max(i,j) for i,j in zip(b,a))

n, m, k = li()
l = []
for i in range(n):l.append(li())



l1 = [deque() for i in range(m)]
for i in range(m):l1[i].append([0,l[0][i]])

i, j = 0, 1
ans = 0
perm = [0]*m if sum(l[0]) > k else l[0][:]

curr = l[0][:]
while j != n:

    for itr in range(m):
        while len(l1[itr]) and l1[itr][-1][-1] <= l[j][itr]:
            l1[itr].pop()
        l1[itr].append([j,l[j][itr]])



    while i < j and givediff(curr,l[j]) > k:
        i += 1
    
        for itr in range(m):
            while l1[itr][0][0] < i:l1[itr].popleft()
            curr[itr] = l1[itr][0][-1]



    for itr in range(m):curr[itr] = l1[itr][0][-1]



    if ans < j - i + 1 and givediff(l[j],curr) <= k:
        ans = j - i + 1
        perm = [max(a,b) for a,b in zip(l[j],curr)]

    j += 1
    # print(l1,'\n\n\n\n',l[j-1],curr,j,i,ans)
# print(ans)
perm[0] += k - sum(perm)
print(*perm)