#include <bits/stdc++.h>
using namespace std;
int n, m, lim;
int Max[6][100005 << 2];
int shots[6];
void pushup(int rt) {
  for (int i = 1; i <= m; i++) {
    Max[i][rt] = max(Max[i][rt << 1], Max[i][rt << 1 | 1]);
  }
}
void build(int l, int r, int rt) {
  if (l == r) {
    for (int i = 1; i <= m; i++) {
      scanf("%d", &Max[i][rt]);
    }
    return;
  }
  int m = (l + r) >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int query(int* Max, int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) {
    return Max[rt];
  }
  int m = (l + r) >> 1;
  int q1 = -1, q2 = -1;
  if (L <= m) q1 = query(Max, L, R, l, m, rt << 1);
  if (R > m) q2 = query(Max, L, R, m + 1, r, rt << 1 | 1);
  return max(q1, q2);
}
bool ok(int x) {
  int cnt = 0;
  for (int j = 1; j + x - 1 <= n; j++) {
    cnt = 0;
    for (int k = 1; k <= m; k++) {
      int p = query(Max[k], j, j + x - 1, 1, n, 1);
      cnt += p;
    }
    if (cnt <= lim) return true;
  }
  return false;
}
int main() {
  scanf("%d%d%d", &n, &m, &lim);
  build(1, n, 1);
  int lb = 0, ub = n + 1;
  while (ub - lb > 1) {
    int mid = (ub + lb) >> 1;
    if (ok(mid)) {
      lb = mid;
    } else
      ub = mid;
  }
  for (int j = 1; j + lb - 1 <= n && lb; j++) {
    int cnt = 0;
    for (int k = 1; k <= m; k++) {
      int p = query(Max[k], j, j + lb - 1, 1, n, 1);
      cnt += p;
      shots[k] = p;
    }
    if (cnt <= lim) break;
  }
  printf("%d", shots[1]);
  for (int i = 2; i <= m; i++) {
    printf(" %d", shots[i]);
  }
  puts("");
  return 0;
}
