#include <bits/stdc++.h>
using namespace std;
multiset<int> st[7];
int res, rt[7], n, m, k, a[(1 << 17)][7];
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  int res = 0;
  for (int l = 0, r = 0; r < n; r++) {
    for (int j = 0; j < m; j++) st[j].insert(a[r][j]);
    for (; l <= r; l++) {
      int sum = 0;
      for (int j = 0; j < m; j++) sum += *st[j].rbegin();
      if (sum <= k) break;
      for (int j = 0; j < m; j++) st[j].erase(st[j].find(a[l][j]));
    }
    if (res < r - l + 1) {
      res = r - l + 1;
      for (int j = 0; j < m; j++) rt[j] = *st[j].rbegin();
    }
  }
  for (int j = 0; j < m - 1; j++) printf("%d ", rt[j]);
  cout << rt[m - 1] << endl;
  return 0;
}
