#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, M = 6, lg = 20;
int n, m, k, maxsz;
int rmq[M][lg][N], lg2[N], power2[lg], ans[M];
vector<int> a[M];
bool check(int l, int r) {
  if (l >= r) return 1;
  int sum = 0, curlog = lg2[r - l];
  for (int j = 0; j < m; j++)
    sum += max(rmq[j][curlog][l], rmq[j][curlog][r - power2[curlog]]);
  if (sum <= k)
    return 1;
  else
    return 0;
}
int main() {
  cin >> n >> m >> k;
  power2[0] = 1;
  for (int i = 1; i < lg; i++) power2[i] = power2[i - 1] * 2;
  lg2[1] = 0;
  for (int i = 2; i < N; i++) lg2[i] = lg2[i / 2] + 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int b;
      cin >> b;
      a[j].push_back(b);
    }
  }
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) rmq[j][0][i] = a[j][i];
    for (int w = 1; w < lg; w++) {
      for (int i = 0; i < n; i++) {
        if (i + power2[w - 1] < n)
          rmq[j][w][i] =
              max(rmq[j][w - 1][i], rmq[j][w - 1][i + power2[w - 1]]);
        else
          rmq[j][w][i] = rmq[j][w - 1][i];
      }
    }
  }
  int l = 0, r = 0, p2 = 0;
  for (int p1 = 0; p1 < n; p1++) {
    while (p2 <= n && check(p1, p2)) p2++;
    if (r - l < p2 - p1 - 1) l = p1, r = p2 - 1;
  }
  int curlog = lg2[r - l];
  for (int j = 0; j < m; j++) {
    if (l == r) {
      cout << 0 << " ";
      continue;
    }
    cout << max(rmq[j][curlog][l], rmq[j][curlog][r - power2[curlog]]) << " ";
  }
}
