#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k, l = 0, r, sum = 0;
  cin >> n >> m >> k;
  vector<priority_queue<pair<long long, long long>>> v(5);
  vector<long long> ans = {0, 0, 0, 0, 0};
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      long long tek = 0;
      cin >> tek;
      v[j].push(make_pair(tek, i));
    }
    r = i;
    while (l <= r) {
      long long tek = 0;
      for (long long j = 0; j < m; j++) {
        while (v[j].top().second < l) {
          v[j].pop();
        }
        tek += v[j].top().first;
      }
      if (tek <= k) break;
      l++;
    }
    if (r - l + 1 > sum) {
      sum = r - l + 1;
      for (long long j = 0; j < m; j++) {
        ans[j] = v[j].top().first;
      }
    }
  }
  for (long long j = 0; j < m; j++) {
    cout << ans[j] << " ";
  }
}
