#include <bits/stdc++.h>
using namespace std;
char _;
const long long N = 1e6 + 5;
const long long INF = 1e9;
const long long mod = 1e9 + 7;
const long long LOGN = 15;
int a[N][10];
void solve() {
  int n, m, k1;
  cin >> n >> m >> k1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  multiset<int> data[10];
  int ans[10] = {0};
  int len = 0;
  for (int i = 1, j = 1; j <= n; j++) {
    long long sum = 0;
    for (int k = 1; k <= m; k++) {
      data[k].insert(a[j][k]);
      sum += *data[k].rbegin();
    }
    while (sum > k1) {
      sum = 0;
      for (int k = 1; k <= m; k++) {
        data[k].erase(data[k].find(a[i][k]));
        if (data[k].size()) sum += *data[k].rbegin();
      }
      i++;
    }
    if (len < j - i + 1) {
      len = j - i + 1;
      for (int k = 1; k <= m; k++) ans[k] = *data[k].rbegin();
    }
  }
  for (auto i = 1; i <= m; i++) cout << ans[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
