#include <bits/stdc++.h>
using namespace std;
int n, m, k, l, r, i, j, ans;
long long total;
int a[100010][7];
set<pair<int, int> > s[6];
set<int>::iterator it;
int b[101010];
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) cin >> a[i][j];
  l = r = 1;
  while (r <= n) {
    total = 0;
    for (j = 1; j <= m; j++) {
      s[j].insert(make_pair(-a[r][j], 0));
      total += -s[j].begin()->first;
    }
    while (total > k && l <= r) {
      total = 0;
      for (j = 1; j <= m; j++) {
        s[j].erase(make_pair(-a[l][j], 0));
        total += -s[j].begin()->first;
      }
      l++;
    }
    r++;
    if (ans < r - l) {
      ans = r - l;
      for (j = 1; j <= m; j++) b[j] = -s[j].begin()->first;
    }
  }
  for (i = 1; i <= m; i++) cout << b[i] << " ";
  return 0;
}
