#include <bits/stdc++.h>
using namespace std;
int a[100001][6];
int logmax[100001][5][20];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> a[i][j];
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) logmax[i][j][0] = a[i][j];
  int deg = 1;
  int p2 = 2;
  while (p2 <= n) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if ((i + p2 / 2) < n)
          logmax[i][j][deg] =
              max(logmax[i][j][deg - 1], logmax[i + p2 / 2][j][deg - 1]);
    p2 *= 2;
    deg++;
  }
  std::vector<int> curans(5, 0);
  int num = 0;
  for (int i = 0; i < n; i++) {
    int curp2 = p2;
    int curdeg = deg;
    int curnum = 0;
    std::vector<int> curshots(5, 0);
    std::vector<int> newshots(5, 0);
    int curpos = i;
    while (curp2 > 0) {
      if (curpos + curp2 <= n) {
        int sum = 0;
        for (int j = 0; j < m; j++)
          sum += newshots[j] = max(curshots[j], logmax[curpos][j][curdeg]);
        if (sum <= k) {
          curpos += curp2;
          for (int j = 0; j < m; j++) curshots[j] = newshots[j];
        }
      }
      curp2 /= 2;
      curdeg--;
    }
    if ((curpos - i) > num) {
      num = curpos - i;
      for (int j = 0; j < m; j++) curans[j] = curshots[j];
    }
  }
  for (int j = 0; j < m; j++) cout << curans[j] << " ";
}
