#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const int maxn = 100010;
const int maxm = 10;
int n, m, k;
int a[maxn][maxm];
deque<pair<int, int> > dq[maxm];
void solve() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (m); j++) scanf("%d", &a[i][j]);
  int ans[maxm], dmax = 0, cur = 0;
  memset(ans, 0, sizeof(ans));
  for (int i = (0); i < (n); i++) {
    int cnt = 0;
    for (int j = (0); j < (m); j++) {
      while (int((dq[j]).size()) && dq[j].back().first <= a[i][j])
        dq[j].pop_back();
      dq[j].push_back(make_pair(a[i][j], i));
      while (int((dq[j]).size()) && dq[j].front().second < cur)
        dq[j].pop_front();
      cnt += dq[j].front().first;
    }
    if (cnt <= k) {
      if (dmax < i - cur + 1) {
        dmax = i - cur + 1;
        for (int j = (0); j < (m); j++) ans[j] = dq[j].front().first;
      }
    } else {
      while (cnt > k && cur <= i) {
        cnt = 0;
        for (int j = (0); j < (m); j++) {
          while (int((dq[j]).size()) && dq[j].front().second <= cur)
            dq[j].pop_front();
          if (int((dq[j]).size())) cnt += dq[j].front().first;
        }
        cur++;
      }
    }
  }
  for (int i = (0); i < (m); i++) printf("%d ", ans[i]);
}
int main() {
  solve();
  return 0;
}
