#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int> > pq[5];
queue<pair<int, int> > q[5];
int n, m, k, Max, re[5], a[100001][5];
void solve() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      pq[j].push(pair<int, int>(a[i][j], -i));
      q[j].push(pair<int, int>(a[i][j], i));
    }
    while (!q[0].empty()) {
      int sum = 0;
      for (int j = 0; j < m; j++) {
        sum += pq[j].top().first;
      }
      if (sum <= k) {
        if (Max < q[0].size()) {
          Max = q[0].size();
          for (int j = 0; j < m; j++) {
            re[j] = pq[j].top().first;
          }
        }
        break;
      }
      int idx = q[0].front().second;
      for (int j = 0; j < m; j++) {
        q[j].pop();
        while (!pq[j].empty() && -pq[j].top().second <= idx) pq[j].pop();
      }
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d ", re[i]);
  }
  puts("");
}
int main(void) {
  solve();
  return 0;
}
