#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pci = pair<char, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
const ll infll = 1e18 + 3;
const int maxn = 1e6 + 77;
const int nmax = 1e6 + 77;
const ll basell = 1e18 + 3;
const int mod = 1e9 + 7;
const ld eps = 1e-7;
const int inf = 1009000999;
const int nv = 100505;
const int baseint = 1000200013;
const ld PI = acos(-1.0);
inline bool EQ(ld a, ld b) { return fabs(a - b) < 1e-9; }
int a[nv][6];
int t[4 * 100000][6];
void build(int v, int vl, int vr, int x) {
  if (vl == vr) {
    t[v][x] = a[vl][x];
    return;
  }
  int vm = vl + (vr - vl) / 2;
  build(2 * v + 1, vl, vm, x);
  build(2 * v + 2, vm + 1, vr, x);
  t[v][x] = max(t[2 * v + 1][x], t[2 * v + 2][x]);
}
int query(int v, int vl, int vr, int l, int r, int x) {
  if (r < vl || vr < l) return 0;
  if (l <= vl && vr <= r) return t[v][x];
  int vm = vl + (vr - vl) / 2;
  int ql = query(2 * v + 1, vl, vm, l, r, x);
  int qr = query(2 * v + 2, vm + 1, vr, l, r, x);
  return max(ql, qr);
}
int inline solve() {
  ios::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
  ;
  int n, m, k;
  cin >> n >> m >> k;
  for (int r = 0; r < n; ++r) {
    for (int i = 0; i < m; ++i) {
      cin >> a[r][i];
    }
  }
  for (int i = 0; i < m; ++i) {
    build(0, 0, n - 1, i);
  }
  int l = 0;
  int len = 0, x = -1, y = -1;
  for (int r = 0; r < n; ++r) {
    int sum = 0;
    for (int i = 0; i < m; ++i) {
      sum += query(0, 0, n - 1, l, r, i);
    }
    while (sum > k) {
      l++;
      if (l > r) break;
      sum = 0;
      for (int i = 0; i < m; ++i) {
        sum += query(0, 0, n - 1, l, r, i);
      }
    }
    if (r - l + 1 > len) len = r - l + 1, x = l, y = r;
  }
  for (int i = 0; i < m; ++i) {
    if (x == -1)
      cout << "0 ";
    else
      cout << query(0, 0, n - 1, x, y, i) << " ";
  }
  return 0;
}
int32_t main() {
  solve();
  return 0;
}
