#include <bits/stdc++.h>
using namespace std;
class segTree {
 public:
  int val[100005];
  int tree[4 * 100005];
  segTree() { memset(tree, 0, sizeof tree); }
  void initialize(int n, int s, int e) {
    if (s == e) {
      tree[n] = val[s];
      return;
    }
    int mid = (s + e) >> 1, l = 2 * n, r = 2 * n + 1;
    initialize(l, s, mid);
    initialize(r, mid + 1, e);
    tree[n] = max(tree[l], tree[r]);
  }
  int qry(int n, int s, int e, int qs, int qe) {
    if (s > qe || e < qs) return INT_MIN;
    if (s >= qs && e <= qe) return tree[n];
    int mid = (s + e) >> 1, l = 2 * n, r = 2 * n + 1;
    int m1 = qry(l, s, mid, qs, qe);
    int m2 = qry(r, mid + 1, e, qs, qe);
    return max(m1, m2);
  }
} trees[5];
int sum(vector<int>& v) {
  int ans = 0;
  for (int i = 0; i < (int)v.size(); i++) ans += v[i];
  return ans;
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &trees[j].val[i]);
  for (int i = 0; i < m; i++) trees[i].initialize(1, 0, n - 1);
  vector<int> mx(m, 0), res(m, 0);
  int r = 0, l = 0, ans = 0;
  while (r < n) {
    for (int i = 0; i < m; i++) mx[i] = trees[i].qry(1, 0, n - 1, l, r);
    if (sum(mx) <= k) {
      if (ans < r - l + 1) {
        res = mx;
        ans = r - l + 1;
      }
      r++;
    } else
      l++;
  }
  for (int i = 0; i < m; i++) {
    if (i) printf(" ");
    printf("%d", res[i]);
  }
  printf("\n");
}
