#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[6], otv[6], d[6][1700001], l, r, len, MX, i, j, x;
long long all;
void update(int pos, int x) {
  x >>= 1;
  while (x) {
    d[pos][x] = max(d[pos][x * 2], d[pos][x * 2 + 1]);
    x >>= 1;
  }
}
int found(int pos, int l, int r) {
  int MX = 0;
  while (l <= r) {
    if (l % 2 == 1) MX = max(MX, d[pos][l]);
    if (r % 2 == 0) MX = max(MX, d[pos][r]);
    l++;
    r--;
    l >>= 1;
    r >>= 1;
  }
  return MX;
}
int main() {
  cin >> n >> m >> k;
  len = 1;
  while (len < n) len *= 2;
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= m; ++j) {
      scanf("%d", &x);
      d[j][i + len - 1] = x;
      update(j, i + len - 1);
    }
  }
  l = 1;
  r = 1;
  while (l <= n && r <= n) {
    if (l > r) r = l;
    all = 0;
    for (i = 1; i <= m; ++i) a[i] = found(i, l + len - 1, r + len - 1);
    for (i = 1; i <= m; ++i) all += a[i];
    if (all <= k) {
      if (MX < r - l + 1) {
        for (i = 1; i <= m; ++i) otv[i] = a[i];
        MX = r - l + 1;
      }
      ++r;
    } else
      ++l;
  }
  for (i = 1; i <= m; ++i) cout << otv[i] << " ";
  return 0;
}
