#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int T, n, m, k, len, ans[6], lg[MAXN];
int f[MAXN][6][20];
int ma(int i, int l, int r) {
  int p = lg[r - l + 1];
  return max(f[l][i][p], f[r - (1 << p) + 1][i][p]);
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  memset(f, 0, sizeof(f));
  len = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &f[i][j][0]);
  for (int j = 1; (1 << j) <= n; j++)
    for (int i = 1; i + (1 << j) - 1 <= n; i++)
      for (int p = 1; p <= m; p++)
        f[i][p][j] = max(f[i][p][j - 1], f[i + (1 << (j - 1))][p][j - 1]);
  for (int i = 2; i <= n; i++) lg[i] = lg[i >> 1] + 1;
  for (int i = 1; i <= n; i++) {
    int l = i - 1, r = n;
    while (l < r) {
      int mid = (l + r + 1) / 2;
      int tmp = 0;
      for (int p = 1; p <= m; p++) tmp += ma(p, i, mid);
      if (tmp <= k)
        l = mid;
      else
        r = mid - 1;
    }
    if (l - i + 1 > len) {
      len = l - i + 1;
      for (int p = 1; p <= m; p++) ans[p] = ma(p, i, l);
    }
  }
  for (int i = 1; i <= m; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
