#include <bits/stdc++.h>
int a[100005][6], maxn[100005][20][6];
int max(int a, int b) { return a > b ? a : b; }
void init(int n, int m) {
  int i, j, k;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) maxn[i][0][j] = a[i][j];
  for (j = 1; (1 << j) <= n; j++)
    for (i = 0; i + (1 << j) - 1 < n; i++)
      for (k = 0; k < m; k++)
        maxn[i][j][k] =
            max(maxn[i][j - 1][k], maxn[i + (1 << (j - 1))][j - 1][k]);
}
int rmq(int l, int r, int id) {
  int k = 0;
  while ((1 << (k + 1)) <= r - l + 1) k++;
  return max(maxn[l][k][id], maxn[r - (1 << k) + 1][k][id]);
}
int f(int l, int r, int m) {
  int i, res = 0;
  for (i = 0; i < m; i++) res += rmq(l, r, i);
  return res;
}
int main() {
  int n, m, k, i, j;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &a[i][j]);
  init(n, m);
  int ans = -1, pos1, pos2;
  for (i = 0; i < n; i++) {
    int l = i, r = n - 1, mid;
    while (l <= r) {
      mid = (l + r) / 2;
      int tmp = f(i, mid, m);
      if (tmp > k)
        r = mid - 1;
      else
        l = mid + 1;
    }
    int res = r - i + 1;
    if (res > ans) {
      ans = res;
      pos1 = i;
      pos2 = r;
    }
  }
  if (ans <= 0) {
    for (i = 0; i < m; i++) printf("0 ");
    puts("");
    return 0;
  }
  for (i = 0; i < m; i++) printf("%d ", rmq(pos1, pos2, i));
  puts("");
  return 0;
}
