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.
#include <bits/stdc++.h>
using namespace std;
const long long int N = 5e5 + 5;
void fun() {}
long long int md = 1e9 + 7;
long long int __gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return __gcd(b, a % b);
}
long long int poww(long long int a, long long int b, long long int md) {
  long long int res = 1;
  while (b) {
    if (b & 1) {
      res = (1ll * res * a) % md;
    }
    a = (1ll * a * a) % md;
    b >>= 1;
  }
  return res;
}
void ainp(long long int arr[], long long int n) {
  for (long long int i = 0; i < n; i++) cin >> arr[i];
}
const long long int size = 1e5 + 1;
long long int mat[size][6];
long long int n, m, k;
long long int sparse[size][6][19];
long long int logarray[size];
void calclogarray() {
  logarray[0] = 0;
  logarray[1] = 0;
  logarray[2] = 1;
  for (long long int i = 3; i < size; i++) logarray[i] = logarray[i / 2] + 1;
}
void makesparse() {
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 1; j <= m; j++) sparse[i][j][0] = mat[i][j];
  for (long long int bits = 1; bits < 19; bits++)
    for (long long int i = 1; i + (1 << bits) <= n + 1; i++)
      for (long long int j = 1; j <= m; j++)
        sparse[i][j][bits] = max(sparse[i][j][bits - 1],
                                 sparse[i + (1 << (bits - 1))][j][bits - 1]);
}
bool check(long long int l, long long int r) {
  long long int logg = logarray[r - l + 1];
  long long int sum = 0;
  for (long long int i = 1; i <= m; i++) {
    sum += max(sparse[l][i][logg], sparse[r - (1 << logg) + 1][i][logg]);
  }
  if (sum > k) return false;
  return true;
}
long long int midisokay(long long int mid) {
  for (long long int l = 1; l <= n - mid + 1; l++) {
    if (check(l, l + mid - 1)) return l;
  }
  return 0;
}
void output(long long int l, long long int r) {
  long long int logg = logarray[r - l + 1];
  for (long long int i = 1; i <= m; i++)
    cout << max(sparse[l][i][logg], sparse[r - (1 << logg) + 1][i][logg])
         << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  fun();
  cin >> n >> m >> k;
  calclogarray();
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 1; j <= m; j++) cin >> mat[i][j];
  makesparse();
  long long int ans[6];
  long long int low = 1, high = n;
  long long int maxrange = 0;
  long long int ll;
  while (low <= high) {
    long long int mid = (low + high) / 2;
    if (long long int l = midisokay(mid)) {
      low = mid + 1;
      if (maxrange < (mid)) maxrange = mid, ll = l;
    } else
      high = mid - 1;
  }
  if (maxrange == 0)
    for (long long int i = 0; i < m; i++) cout << "0 ";
  else
    output(ll, maxrange + ll - 1);
  cout << "\n";
  return 0;
}
