#include <bits/stdc++.h>
using namespace std;
const int K = 5;
int k;
struct Node {
  int v[K];
  Node() { fill(v, v + K, 0); }
  Node(vector<int> &v_) {
    fill(v, v + K, 0);
    for (int i = 0; i < k; i++) {
      v[i] = v_[i];
    }
  }
  Node(int *v_) {
    fill(v, v + K, 0);
    for (int i = 0; i < k; i++) {
      v[i] = v_[i];
    }
  }
  friend Node conq(const Node &l, const Node &r) {
    int nv[K];
    for (int i = 0; i < k; i++) {
      nv[i] = max(l.v[i], r.v[i]);
    }
    return Node(nv);
  }
  void print() {
    for (int i = 0; i < k; i++) {
      cout << v[i] << ' ';
    }
    cout << '\n';
  }
  int solve() {
    int ans = 0;
    for (int i = 0; i < k; i++) {
      ans += v[i];
    }
    return ans;
  }
};
const int N = 1e5;
int n;
namespace SegmentTree {
Node t[4 * N];
void pull(int v) { t[v] = conq(t[2 * v + 1], t[2 * v + 2]); }
void build(int v, int l, int r, vector<vector<int>> &a) {
  if (l + 1 == r) {
    t[v] = Node(a[l]);
  } else {
    int m = (r + l) >> 1;
    build(2 * v + 1, l, m, a);
    build(2 * v + 2, m, r, a);
    pull(v);
  }
}
void query(int v, int l, int r, int ql, int qr, Node &ans) {
  if (qr <= l || r <= ql) {
    return;
  } else if (ql <= l && r <= qr) {
    ans = conq(ans, t[v]);
  } else {
    int m = (r + l) >> 1;
    query(2 * v + 1, l, m, ql, qr, ans);
    query(2 * v + 2, m, r, ql, qr, ans);
  }
}
int query(int l, int r) {
  Node ans;
  query(0, 0, n, l, r, ans);
  return ans.solve();
}
Node rq(int l, int r) {
  Node ans;
  query(0, 0, n, l, r, ans);
  return ans;
}
void build(vector<vector<int>> &a) { build(0, 0, n, a); }
}  // namespace SegmentTree
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int can;
  cin >> n >> k >> can;
  vector<vector<int>> a(n, vector<int>(k));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++) {
      cin >> a[i][j];
    }
  }
  SegmentTree::build(a);
  int r = -1;
  int ans = -1;
  int best_l = -1;
  int best_r = -1;
  for (int i = 0; i < n; i++) {
    r = max(r, i);
    while (r <= n && SegmentTree::query(i, r + 1) <= can) {
      r++;
    }
    if (ans < r - i) {
      ans = r - i;
      best_l = i;
      best_r = r;
    }
  }
  Node t = SegmentTree::rq(best_l, best_r);
  t.print();
}
