#include <bits/stdc++.h>
using namespace std;
int a[100005][6];
int b[6];
struct {
  int st[400000];
  void update(int n, int s, int e, int idx, int v) {
    if (s == e)
      st[n] = v;
    else {
      int mid = (s + e) / 2;
      if (idx <= mid)
        update(n + n, s, mid, idx, v);
      else
        update(n + n + 1, mid + 1, e, idx, v);
      st[n] = max(st[n + n], st[n + n + 1]);
    }
  }
  int query(int n, int s, int e, int l, int r) {
    if (s > r || l > e) return -2e9;
    if (l <= s && e <= r) return st[n];
    int mid = (s + e) / 2;
    int q1 = query(n + n, s, mid, l, r);
    int q2 = query(n + n + 1, mid + 1, e, l, r);
    return max(q1, q2);
  }
} st[6];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
      st[j].update(1, 1, n, i, a[i][j]);
    }
  }
  int ans = 0, le = 0, ri = 0;
  for (int i = 1; i <= n; i++) {
    int lo = i, hi = n, r = i - 1;
    while (lo <= hi) {
      int mid = (lo + hi) / 2;
      for (int j = 1; j <= m; j++) b[j] = st[j].query(1, 1, n, i, mid);
      int res = 0;
      for (int j = 1; j <= m; j++) res += b[j];
      if (res <= k)
        r = mid, lo = mid + 1;
      else
        hi = mid - 1;
    }
    if (r - i + 1 >= ans) {
      ans = r - i + 1;
      le = i, ri = r;
    }
  }
  if (ans == 0) {
    for (int i = 1; i <= m; i++) printf("0 ");
  } else {
    for (int i = 1; i <= m; i++) printf("%d ", st[i].query(1, 1, n, le, ri));
  }
}
