#include <bits/stdc++.h>
using namespace std;
int tree[5][4 * (long long int)(5e5 + 5) + 5], v[(long long int)(5e5 + 5)][5],
    n, m, k;
void build(int s = 0, int e = n - 1, int x = 1) {
  if (s == e) {
    for (int i = 0; i < 5; i++) tree[i][x] = v[s][i];
  } else {
    build(s, (s + e) / 2, x * 2);
    build((s + e) / 2 + 1, e, x * 2 + 1);
    for (int i = 0; i < 5; i++)
      tree[i][x] = max(tree[i][x * 2], tree[i][x * 2 + 1]);
  }
}
int query(int i, int qs, int qe, int s = 0, int e = n - 1, int x = 1) {
  if (s > qe || e < qs) return 0;
  if (s >= qs && e <= qe)
    return tree[i][x];
  else
    return max(query(i, qs, qe, s, (s + e) / 2, x * 2),
               query(i, qs, qe, (s + e) / 2 + 1, e, x * 2 + 1));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> v[i][j];
  build();
  vector<long long int> c(m), fm(m);
  int l = 0, r = 0, s = 0, f = 0;
  while (l < n && r < n) {
    s = 0;
    for (int i = 0; i < m; i++) c[i] = query(i, l, r), s += c[i];
    if (s <= k) {
      if (r - l + 1 > f) f = r - l + 1, fm = c;
      r++;
    } else
      l++, r = max(r, l);
  }
  for (long long int it = 0; it < fm.size(); it++) cout << fm[it] << " ";
  cout << endl;
}
