#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, t, f[N][6][18], lg[N];
int sum(int l, int r) {
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    ans += max(f[l][i][lg[r - l + 1]],
               f[r - (1 << lg[r - l + 1]) + 1][i][lg[r - l + 1]]);
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &m, &t);
  for (int i = 2; i <= n; i++) lg[i] = lg[i >> 1] + 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &f[i][j][0]);
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int k = 1; k <= 16; k++) {
      for (int i = 1; i + (1 << k) - 1 <= n; i++) {
        f[i][j][k] = max(f[i][j][k - 1], f[i + (1 << (k - 1))][j][k - 1]);
      }
    }
  }
  int ans = 0, ansi = 0;
  for (int i = 1; i <= n; i++) {
    while (i + ans <= n && sum(i, i + ans) <= t) {
      ans++, ansi = i;
    }
  }
  for (int i = 1; i <= m; i++) {
    printf("%d ", ans > 0 ? max(f[ansi][i][lg[ans]],
                                f[ansi + ans - (1 << lg[ans])][i][lg[ans]])
                          : 0);
  }
  return 0;
}
