#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, m, k, maxi[5][100010][21], logg[100010];
ll lef, rig;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> maxi[j][i][0];
    }
    if (i != 1) logg[i] = logg[i / 2] + 1;
  }
  for (ll pw = 1; pw <= logg[n]; pw++) {
    for (int st = 1; st + (1 << pw) - 1 <= n; st++) {
      for (int type = 0; type < m; type++) {
        maxi[type][st][pw] = max(maxi[type][st][pw - 1],
                                 maxi[type][st + (1ll << (pw - 1))][pw - 1]);
      }
    }
  }
  function<bool(ll len)> pred;
  auto getmax = [&](int lf, int rg, int type) {
    int loge = logg[rg - lf + 1];
    return max(maxi[type][lf][loge], maxi[type][rg - (1ll << loge) + 1][loge]);
  };
  pred = [&](ll len) {
    for (int i = 1; i + len - 1 <= n; i++) {
      ll req = 0;
      for (int type = 0; type < m; type++) {
        req += getmax(i, i + len - 1, type);
      }
      if (req <= k) {
        lef = i, rig = i + len - 1;
        return 0;
      }
    }
    return 1;
  };
  ll lo = 0, hi = n;
  while (lo < hi) {
    ll mid = lo + (hi - lo + 1) / 2;
    if (pred(mid)) {
      hi = mid - 1;
    } else {
      lo = mid;
    }
  }
  pred(lo);
  for (int type = 0; type < m; type++) {
    cout << getmax(lef, rig, type) << ' ';
  }
}
