#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n, m, k, a[N][5];
int sparse[5][17][N];
vector<int> last(5, 0);
void build(int u) {
  for (int i = 0; i < n; i++) sparse[u][0][i] = a[i][u];
  for (int j = 1; j <= 17; j++)
    for (int i = 0; i + (1 << (j - 1)) < n; i++)
      sparse[u][j][i] =
          max(sparse[u][j - 1][i], sparse[u][j - 1][i + (1 << (j - 1))]);
}
int q(int u, int x, int y) {
  int v = log2(y - x + 1);
  return max(sparse[u][v][x], sparse[u][v][y + 1 - (1 << v)]);
}
bool check(int mid) {
  vector<int> v(5, 0);
  int sum;
  for (int i = 0; i < n - mid; i++) {
    sum = 0;
    for (int j = 0; j < m; j++) {
      v[j] = q(j, i, i + mid);
      sum += v[j];
    }
    if (sum <= k) {
      last = v;
      return 1;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  for (int i = 0; i < m; i++) build(i);
  int l = 0, r = n, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  for (int i = 0; i < m; i++) cout << last[i] << " ";
}
