#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int N, M, K;
int A[5][MAXN];
multiset<int> st[5];
int ans, nshots[5];
bool ok() {
  int s = 0;
  for (int i = 0; i < 5; i++) {
    s += st[i].empty() ? 0 : *st[i].rbegin();
  }
  return s <= K;
}
void process(int diff) {
  if (ans >= diff) {
    return;
  }
  ans = diff;
  for (int i = 0; i < 5; i++) {
    nshots[i] = *st[i].rbegin();
  }
}
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  ios::sync_with_stdio(false);
  cin >> N >> M >> K;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[j][i];
    }
  }
  for (int i = 0, j = 0; i < N || j < N;) {
    if (j == N) {
      if (ok()) {
        process(j - i);
        for (int k = 0; k < 5; k++) {
          st[k].erase(st[k].find(A[k][i]));
        }
        i++;
      } else {
        break;
      }
    } else {
      if (ok()) {
        process(j - i);
        for (int k = 0; k < 5; k++) {
          st[k].insert(A[k][j]);
        }
        j++;
      } else {
        for (int k = 0; k < 5; k++) {
          st[k].erase(st[k].find(A[k][i]));
        }
        i++;
      }
    }
  }
  for (int i = 0; i < M; i++) {
    cout << nshots[i] << ' ';
  }
}
