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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R2D2AndDroidArmy {
	public static void main(String[] args) {
		InputStream input;
		OutputStream output;
		try {
			input = new FileInputStream("input.txt");
			output = new FileOutputStream("output.txt");
		} catch (FileNotFoundException e) {
			input = System.in;
			output = System.out;
		}
		Kattio io = new Kattio(input, output);
		//int t=io.getInt();
		//for (int i=1; i<=t; i++)
		(new Solve(io)).main();
		io.close();

		if (input instanceof FileInputStream)
			try {
				input.close();
			} catch (IOException e) {
			}
		if (output instanceof FileOutputStream)
			try {
				output.close();
			} catch (IOException e) {
			}
	}
}

class RMQ
{
	int n;
	int[] arr;
	int[] l,r;
	int[] dat;
	int[] pos;
	
	public RMQ(int n)
	{
		this.n = n;
		arr = new int[n+1];
		dat = new int[4*n+1];
		l = new int[4*n+1];
		r = new int[4*n+1];
		pos = new int[n+1];
		RMQHelper(1,1,n);
	}
	
	private void RMQHelper(int i,int x,int y)
	{
		l[i]=x;
		r[i]=y;
		if (x==y)
		{
			dat[i]=arr[x];
			pos[x]=i;
		}
		else
		{
			int m=(x+y)/2;
			RMQHelper(i*2,x,m);
			RMQHelper(i*2+1,m+1,y);
			dat[i]=Math.max(dat[i*2], dat[i*2+1]);
		}
	}
	
	public void update(int x,int y)
	{
		arr[x] = y;
		dat[pos[x]] = y;
		updateHelper(pos[x]/2);
	}
	
	private void updateHelper(int x)
	{
		if (x==0) return;
		
		dat[x] = Math.max(dat[x*2],dat[x*2+1]);
		updateHelper(x/2);
	}
	
	public int get(int l,int r)
	{
		return getHelper(1,l,r);
	}
	
	private int getHelper(int i,int x,int y)
	{
		int res;
		if (y<l[i] || x>r[i]) res=0;
		else
		if (x<=l[i] && r[i]<=y) res=dat[i];
		else
		{
			res=getHelper(i*2,x,y);
			res=Math.max(res,getHelper(i*2+1,x,y));
		}
		
		return res;
	}

	@Override
	public String toString() {
		return "RMQ [n=" + n + ", arr=" + Arrays.toString(arr) + ", l=" + Arrays.toString(l) + ", r="
				+ Arrays.toString(r) + ", dat=" + Arrays.toString(dat) + ", pos=" + Arrays.toString(pos) + "]";
	}
}

class RMQEfficient
{
	int n;
	int[] arr;
	int[][] rmq;
	int[] pow;
	int[] mn;
	
	public RMQEfficient(int[] arr)
	{
		this.n = arr.length-1;
		
		this.arr = new int[arr.length];
		for (int i=1; i<=n; i++)
			this.arr[i] = arr[i];
		
		initPowMn();
		initRMQ();
	}
	
	private void initPowMn()
	{
		pow = new int[31];
		pow[0] = 1;
		
		mn = new int[n+1];
		Arrays.fill(mn, 0);
		
		for (int i=1; i<=30; i++)
		{
			pow[i]=2*pow[i-1];
			if (pow[i]<=n) 
			{
				try
				{
					mn[pow[i]] = i;
				}
				catch (IndexOutOfBoundsException e)
				{
					System.out.println(n+" "+pow[i]+" "+i);
				}
			}
		}
		
		for (int i=1; i<=n; i++)
			mn[i] = Math.max(mn[i-1], mn[i]);
	}
	
	private void initRMQ()
	{
		rmq = new int[n+1][31];
		for (int i=1; i<=n; i++)
			Arrays.fill(rmq[i],-1);
		for (int i=1; i<=n; i++)
			for (int j=0; j<=30; j++)
				initRMQHelper(i,j);
	}
	
	private int initRMQHelper(int x,int y)
	{
		if (x>n) return 0;
		else
		if (rmq[x][y]!=-1) return rmq[x][y];
		else
		if (y==0)
			rmq[x][y]=arr[x];
		else
		{
			int endSide = x+pow[y]-1;
			rmq[x][y]=Math.max(initRMQHelper(x,y-1),
					initRMQHelper(endSide-pow[y-1]+1,y-1));
		}
		return rmq[x][y];
	}
	
	public int get(int l,int r)
	{
		if (r<l) return 0;
		//System.out.println("get "+l+" "+r);
		int length = (r-l+1);
		int step = mn[length];
		//System.out.println(step);
		try
		{
			return Math.max(rmq[l][step],rmq[r-pow[step]+1][step]);
		}
		catch (ArrayIndexOutOfBoundsException e)
		{
			System.out.println(l+" "+r+" "+(r-pow[step]+1)+" "+step);
			return 0;
		}
	}
	
}

class Solve {
	Kattio io;
	int n,m,k;
	int[][] a;
	RMQEfficient[] ds;
	Solve(Kattio io) {
		this.io = io;
	}
	
	boolean check(int l,int r)
	{
		//io.println("check "+l+" "+r);
		if (r>n) return false;
		int sum = 0;
		for (int i=1; i<=m; i++)
		{
			//io.println("check "+l+" "+r);
			sum+=ds[i].get(l, r);
		}
		return (sum<=k);
	}

	void main() {
		n=io.getInt();
		m=io.getInt();
		k=io.getInt();
		a = new int[n+1][m+1];
		for (int i=1; i<=n; i++)
			for (int j=1; j<=m; j++)
				a[i][j]=io.getInt();
		
		ds = new RMQEfficient[m+1];
		
		for (int i=1; i<=m; i++)
		{
			int[] init = new int[n+1];
			for (int j=1; j<=n; j++)
				init[j]=a[j][i];
			ds[i] = new RMQEfficient(init);
		}
		
		//for (int i=1; i<=m; i++)
		//	io.println(ds[i]);
		
		int res = 0;
		int vtres = 0;
		for (int i=1; i<=n; i++)
		{
			int dau = i, cuoi = n;
			do
			{
				int giua=(dau+cuoi)/2;
				if (check(i,giua)) dau=giua+1;
				else cuoi=giua-1;
			}
			while (dau<=cuoi);
			
			if (cuoi-i+1>res)
			{
				res=cuoi-i+1;
				vtres=i;
			}
		}
		
		for (int i=1; i<=m; i++)
			io.print(ds[i].get(vtres,vtres+res-1)+" ");
		
	}
}

class Kattio extends PrintWriter {
	public Kattio(InputStream i) {
		super(new BufferedOutputStream(System.out));
		r = new BufferedReader(new InputStreamReader(i));
	}

	public Kattio(InputStream i, OutputStream o) {
		super(new BufferedOutputStream(o));
		r = new BufferedReader(new InputStreamReader(i));
	}

	public boolean hasMoreTokens() {
		return peekToken() != null;
	}

	public int getInt() {
		return Integer.parseInt(nextToken());
	}

	public double getDouble() {
		return Double.parseDouble(nextToken());
	}

	public long getLong() {
		return Long.parseLong(nextToken());
	}

	public String getWord() {
		return nextToken();
	}

	private BufferedReader r;
	private String line;
	private StringTokenizer st;
	private String token;

	private String peekToken() {
		if (token == null)
			try {
				while (st == null || !st.hasMoreTokens()) {
					line = r.readLine();
					if (line == null)
						return null;
					st = new StringTokenizer(line);
				}
				token = st.nextToken();
			} catch (IOException e) {
			}
		return token;
	}

	private String nextToken() {
		String ans = peekToken();
		token = null;
		return ans;
	}
}