#include <bits/stdc++.h>
using namespace std;
struct Sparse_Table {
  vector<vector<long long>> st;
  vector<long long> max2;
  Sparse_Table(vector<long long> &a) {
    long long n = a.size();
    st.emplace_back();
    for (long long i = 0; i < n; i++) {
      st[0].push_back(a[i]);
    }
    for (long long i = 1; (1 << i) <= n; i++) {
      st.emplace_back();
      for (long long p = 0; p + (1 << i) <= n; p++) {
        st[i].push_back(max(st[i - 1][p], st[i - 1][p + (1 << (i - 1))]));
      }
    }
    max2.resize(n + 1);
    max2[1] = 0;
    for (long long i = 2; i <= n; i++) {
      max2[i] = max2[i / 2] + 1;
    }
  }
  long long rmq(long long l, long long r) {
    long long i = max2[r - l];
    return max(st[i][l], st[i][r - (1 << i)]);
  }
};
long long f(long long l, long long r, vector<Sparse_Table> &sts) {
  long long res = 0;
  for (auto &st : sts) {
    res += st.rmq(l, r + 1);
  }
  return res;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, m, k;
  cin >> n >> m >> k;
  vector<vector<long long>> arr(m, vector<long long>(n));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> arr[j][i];
    }
  }
  vector<Sparse_Table> sts;
  for (long long i = 0; i < m; i++) {
    sts.emplace_back(Sparse_Table(arr[i]));
  }
  long long ind = 0, best = 0;
  for (long long i = 0; i < n; i++) {
    long long l = i, r = n;
    if (f(l, l, sts) > k) {
      continue;
    }
    while (r - l > 1) {
      long long m1 = (r + l) / 2;
      if (f(i, m1, sts) <= k) {
        l = m1;
      } else {
        r = m1;
      }
    }
    if (l - i + 1 > best) {
      best = l - i + 1;
      ind = i;
    }
  }
  vector<long long> ans;
  for (long long i = 0; i < m; i++) {
    if (ind + best > ind) {
      ans.push_back(sts[i].rmq(ind, ind + best));
    } else {
      ans.push_back(0);
    }
  }
  for (auto x : ans) {
    cout << x << " ";
  }
  cout << "\n";
}
