#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 29996224275833;
const ll root = 62;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
ll binpow(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
ll modInv(ll a) { return binpow(a, MOD - 2); }
const double PI = acos(-1);
const double eps = -1e6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 100001;
int n, m, k;
int ans[5];
int mx[5];
int arr[mxN][5];
int main() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin.tie(0)->sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (m); ++j) {
      cin >> arr[i][j];
    }
  }
  multiset<int> detsz[5];
  for (int j = (0); j < (m); ++j) {
    detsz[j].insert(0);
  }
  int l = 0;
  int mxans = 0;
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (m); ++j) {
      detsz[j].insert(arr[i][j]);
      mx[j] = *detsz[j].rbegin();
    }
    ll sum = 0;
    for (int j = (0); j < (m); ++j) {
      sum += mx[j];
    }
    if (sum <= k) {
      if (i - l + 1 > mxans) {
        mxans = i - l + 1;
        for (int j = (0); j < (m); ++j) {
          ans[j] = mx[j];
        }
      }
    } else {
      for (int j = (0); j < (m); ++j) {
        detsz[j].erase(detsz[j].find(arr[l][j]));
      }
      l++;
    }
  }
  for (int i = (0); i < (m); ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
