#include <bits/stdc++.h>
using namespace std;
int dp[5][100005][20];
int n, m, k;
int p1[5], p2[5];
void RMQ(int h) {
  for (int i = 1; (1 << i) <= n; i++) {
    for (int j = 0; j + (1 << i) <= n; j++) {
      dp[h][j][i] = max(dp[h][j][i - 1], dp[h][j + (1 << (i - 1))][i - 1]);
    }
  }
}
int Query(int l, int r) {
  int k = 0;
  while (1 << (1 + k) <= r - l + 1) k++;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    p2[i] = max(dp[i][l][k], dp[i][r - (1 << k) + 1][k]);
    ans += p2[i];
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &dp[j][i][0]);
    }
  }
  for (int i = 0; i < m; i++) {
    RMQ(i);
  }
  int l = 0, maxs = 1;
  while (l + maxs <= n) {
    int d = Query(l, l + maxs - 1);
    if (k >= d) {
      memcpy(p1, p2, sizeof(p2));
      maxs++;
    } else
      l++;
  }
  printf("%d", p1[0]);
  for (int i = 1; i < m; i++) printf(" %d", p1[i]);
  puts("");
  return 0;
}
