#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int ans[5];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  int l = 0, r = -1, mx = 0;
  priority_queue<pair<int, int> > pq[5];
  for (int i = 0; i < n; ++i) {
    r = i;
    for (int j = 0; j < m; ++j) {
      long long a;
      cin >> a;
      pq[j].push({a, i});
    }
    while (l <= r) {
      long long F = 0;
      for (int j = 0; j < m; ++j) {
        while (pq[j].top().second < l) pq[j].pop();
        F += pq[j].top().first;
      }
      if (F <= k) break;
      l++;
    }
    if (mx < r - l + 1) {
      mx = r - l + 1;
      for (int j = 0; j < m; ++j) ans[j] = pq[j].top().first;
    }
  }
  for (int j = 0; j < m; ++j) cout << ans[j] << " ";
}
