#include <bits/stdc++.h>
using namespace std;
int n, m, k;
struct sparseTable {
  int A[100005], ST[20][100005];
  void build() {
    int h = 20;
    for (int j = 0; j < n; j++) ST[0][j] = A[j];
    for (int i = 1; i <= h; i++)
      for (int j = 0; j + (1 << i) <= n; j++)
        ST[i][j] = max(ST[i - 1][j], ST[i - 1][j + (1 << (i - 1))]);
  }
  int query(int l, int r) {
    r++;
    int p = 31 - __builtin_clz((r - l));
    return max(ST[p][l], ST[p][r - (1 << p)]);
  }
} s[6];
bool check(int st, int en) {
  int sum = 0;
  for (int i = 0; i < m; i++) {
    sum += s[i].query(st, en);
  }
  return sum <= k;
}
int lo, ro;
bool checkLen(int len) {
  if (len == n + 1) return false;
  for (int i = 0; i < n - len + 1; i++) {
    if (check(i, i + len - 1)) {
      lo = i;
      ro = i + len - 1;
      return true;
    }
  }
  return false;
}
int bs() {
  int l = 0, r = n;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (checkLen(mid) && !checkLen(mid + 1))
      return mid;
    else if (checkLen(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> s[j].A[i];
    }
  }
  for (int j = 0; j < m; j++) {
    s[j].build();
  }
  int len = bs();
  checkLen(len);
  for (int i = 0; i < m; i++) {
    cout << (len != 0 ? s[i].query(lo, ro) : 0) << " ";
  }
}
