#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7, M = 5;
int n, m;
int a[N][M], mx[4 * N][M];
int get(int ql, int qr, int w, int xl = 0, int xr = n, int k = 1) {
  if (ql >= xr || qr <= xl) return 0;
  if (ql <= xl && qr >= xr) return mx[k][w];
  int xm = (xl + xr) / 2;
  return max(get(ql, qr, w, xl, xm, 2 * k), get(ql, qr, w, xm, xr, 2 * k + 1));
}
void build(int w, int xl = 0, int xr = n, int k = 1) {
  if (xr - xl == 1) {
    mx[k][w] = a[xl][w];
    return;
  }
  int xm = (xl + xr) / 2;
  build(w, xl, xm, 2 * k);
  build(w, xm, xr, 2 * k + 1);
  mx[k][w] = max(mx[2 * k][w], mx[2 * k + 1][w]);
}
int k;
bool cango(int p1, int p2) {
  int x = 0;
  for (int i = 0; i < m; i++) {
    x += get(p1, p2, i);
  }
  return (x <= k);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  for (int i = 0; i < m; i++) build(i);
  int j = 0, Max = 0, I = 0, J = 0;
  for (int i = 0; i < n; i++) {
    while (j < n && cango(i, j + 1)) j++;
    if (Max < j - i) {
      Max = j - i;
      J = j, I = i;
    }
  }
  for (int i = 0; i < m; i++) cout << get(I, J, i) << " ";
  cout << endl;
  return 0;
}
