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.IOException;
import java.util.InputMismatchException;

public class R2D2AndDroidArmy {
    public static void main(String[] args) {
        FasterScanner sc = new FasterScanner();
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        long K = sc.nextLong();
        
        SegmentTree[] trees = new SegmentTree[M];
        for (int i = 0; i < M; i++) {
        	trees[i] = new SegmentTree(N);
        }
        
        for (int i = 0; i < N; i++) {
        	for (int j = 0; j < M; j++) {
        		long V = sc.nextLong();
        		trees[j].insert(i, V);
        	}
        }
        
        int head = 0;
        int tail = 0;
        int best = 0;
        long[] chamber = new long[M];
    	while (tail < N) {
        	int sum = 0;
        	long[] currChamber = new long[M];
        	for (int j = 0; j < M; j++) {
        		long tmp = trees[j].get(head, tail);
        		currChamber[j] = tmp;
        		sum += tmp;
        	}
        	if (sum > K) {
        		head++;
        		if (head > tail) {
        			tail = head;
        		}
        	} else {
        		if (best < tail - head + 1) {
        			best = tail - head + 1;
        			chamber = currChamber;
        		}
        		best = Math.max(best, tail - head + 1);
        		tail++;
        	}
        }
    	
    	for (int i = 0; i < M; i++) {
    		System.out.print(chamber[i] + " ");
    	}
    	System.out.println();
    }
    
    /**
     * Here is a Segment Tree implementation.  It currently does sums of longs.
     * See the comments to find where to change the data-type and function of this Segment Tree.
     */
    public static class SegmentTree {
    	public SegmentTreeNode[] leaves;
    	public SegmentTreeNode root;
    	
    	public SegmentTree(int n) {
    		this.leaves = new SegmentTreeNode[n];
    		this.root = new SegmentTreeNode(this, null, 0, n - 1);
    	}
    	
    	// modify the data-type of this segment tree
    	public SegmentTree(long[] vals) {
    		this(vals.length);
    		for (int i = 0; i < vals.length; i++) {
    			this.insert(i,  vals[i]);
    		}
    	}
    	
    	// modify the data-type of this segment tree
    	public void insert(int idx, long v) {
    		this.leaves[idx].setAndUpdate(v);
    	}
    	
    	// modify the data-type of this segment tree
    	public long get(int idx) {
    		return this.leaves[idx].val;
    	}
    	
    	// modify the data-type of this segment tree
    	public long get(int lower, int upper) {
    		return this.root.getRange(lower, upper);
    	}
    	
    	private static class SegmentTreeNode {
    		public int L;
    		public int R;
    		
    		// modify the data-type of this segment tree
    		public long val;
    		
    		public SegmentTree tree;
    		public SegmentTreeNode parent;
    		public SegmentTreeNode left;
    		public SegmentTreeNode rite;
    		
    		public SegmentTreeNode(SegmentTree t, SegmentTreeNode p, int lower, int upper) {
    			this.tree = t;
    			this.parent = p;
    			this.L = lower;
    			this.R = upper;
    			
    			if (lower == upper) {
    				this.tree.leaves[lower] = this;
    			} else {
    				int mid = (lower + upper) / 2;
    				this.left = new SegmentTreeNode(tree, this, lower, mid);
    				this.rite = new SegmentTreeNode(tree, this, mid + 1, upper);
    			}
    		}

    		// modify the data-type of this segment tree
    		public void setAndUpdate(long v) {
    			this.val = v;
    			this.update();
    		}
    		
    		// modify the function (i.e. max, min, sum, etc.) in this method
    		public void update() {
    			if (this.left != null && this.rite != null) {
    				this.val = Math.max(this.left.val, this.rite.val);
    			} else if (this.left != null) {
    				this.val = this.left.val;
    			} else if (this.rite != null) {
    				this.val = this.rite.val;
    			}
    			
    			if (this.parent != null) {
    				this.parent.update();
    			}
    		}
    		
    		// modify the function & the default return value in this method
    		public long getRange(int lower, int upper) {
    			if (this.L >= lower && this.R <= upper) {
    				return this.val;
    			} else if (this.L > upper || this.R < lower) {
    				// modify the default value here (if it's not found)
    				return 0;
    			} else {
    				// modify the function that this Segment Tree uses
    				return Math.max(this.left.getRange(lower, upper), this.rite.getRange(lower, upper));
    			}
    		}
    	}
    }
    
	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	        
	    public int[] nextIntArray(int n) {
	        int[] arr = new int[n];
	        for (int i = 0; i < n; i++) {
	            arr[i] = nextInt();
	        }
	        return arr;
	    }
        
		public long[] nextLongArray(int n) {
		    long[] arr = new long[n];
		    for (int i = 0; i < n; i++) {
		        arr[i] = nextLong();
		    }
		    return arr;
		}

	    private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}