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 int ONE = 1 << 10;
const int TWO = 1 << 11;
const int FOUR = 1 << 12;
const int EIGHT = 1 << 13;
const int SIXTEEN = 1 << 14;
const int THIRTY = 1 << 15;
const int SIXTY = 1 << 16;
const int ONE_HUNDRED = 1 << 17;
const int TWO_HUNDRED = 1 << 18;
const int FIVE_HUNDRED = 1 << 19;
const int MILLION = 1 << 20;
void reads(string &s) {
  char c;
  s.clear();
  while (true) {
    c = getchar();
    if (c != ' ' && c != '\n') {
      s += c;
      break;
    }
  }
  while (true) {
    c = getchar();
    if (c != ' ' && c != '\n')
      s += c;
    else
      break;
  }
}
void prints(string s) {
  int i, sz = s.size();
  for (i = 0; i < sz; i++) printf("%c", s[i]);
}
string takes(string s, int from, int to) {
  int i;
  string ans;
  ans.clear();
  for (i = from; i <= to; i++) ans += s[i];
  return ans;
}
int arr[ONE_HUNDRED];
struct segment_tree {
  int tree[FIVE_HUNDRED];
  void Initialize() { memset(tree, 0, sizeof(tree)); }
  void Build_tree(int a, int b, int node) {
    if (a > b) return;
    if (a == b) {
      tree[node] = arr[a];
      return;
    }
    Build_tree(a, (a + b) >> 1, node << 1);
    Build_tree(((a + b) >> 1) + 1, b, (node << 1) | 1);
    tree[node] = max(tree[node << 1], tree[(node << 1) | 1]);
  }
  int Query_tree(int a, int b, int i, int j, int node) {
    if (a > b || a > j || b < i) return 0;
    if (a >= i && b <= j) return tree[node];
    int q1, q2;
    q1 = Query_tree(a, (a + b) >> 1, i, j, node << 1);
    q2 = Query_tree(((a + b) >> 1) + 1, b, i, j, (node << 1) | 1);
    return max(q1, q2);
  }
} s[6];
int n, m, k;
int a[ONE_HUNDRED][8];
void input() {
  scanf("%d %d %d", &n, &m, &k);
  int i, j;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
}
bool check(int l) {
  int all_shots;
  int from, to, i;
  all_shots = 0;
  for (from = 1; (to = from + l - 1) <= n; from++) {
    all_shots = 0;
    for (i = 1; i <= m; i++) {
      all_shots += s[i].Query_tree(1, n, from, to, 1);
    }
    if (all_shots <= k) return true;
  }
  return false;
}
void solve() {
  int i, j;
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= n; j++) {
      arr[j] = a[j][i];
    }
    s[i].Build_tree(1, n, 1);
  }
  int left, right, middle;
  left = 0;
  right = n + 1;
  while (right - left > 1) {
    middle = (left + right) >> 1;
    if (check(middle))
      left = middle;
    else
      right = middle;
  }
  int all_shots;
  int from, to, l = left;
  all_shots = 0;
  for (from = 1; (to = from + l - 1) <= n; from++) {
    all_shots = 0;
    for (i = 1; i <= m; i++) {
      all_shots += s[i].Query_tree(1, n, from, to, 1);
    }
    if (all_shots <= k) {
      for (i = 1; i <= m; i++) {
        if (i > 1) printf(" ");
        printf("%d", s[i].Query_tree(1, n, from, to, 1));
      }
      printf("\n");
      return;
    }
  }
}
int main() {
  input();
  solve();
  return 0;
}
