#include <bits/stdc++.h>
using namespace std;
const int nsz = 1e5, msz = 5, lgsz = 16;
int n, m, k, a[nsz + 5][msz + 5];
struct sparse_table {
  int lg[nsz + 5], st[nsz + 5][lgsz + 5];
  void inline init(int mem) {
    lg[0] = 1;
    for (int i = 1; i <= n; ++i) {
      lg[i] = lg[i - 1] + (i > (1 << lg[i - 1]));
      st[i][0] = a[i][mem];
    }
    for (int i = 1; i <= lgsz; ++i) {
      for (int u = 1; u <= n; ++u) {
        if (u + (1 << i) - 1 > n) break;
        int p = u + (1 << (i - 1));
        st[u][i] = max(st[u][i - 1], st[p][i - 1]);
      }
    }
  }
  int inline qry(int l, int r) {
    int k = lg[r - l + 1] - 1, len = 1 << k;
    return max(st[l][k], st[r - len + 1][k]);
  }
};
sparse_table st[msz + 5];
int inline read() {
  int res = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); res *= 10, res += c ^ 48, c = getchar())
    ;
  return res;
}
bool inline chk(int mid) {
  int res = 1e9;
  for (int l = 1, r = mid; r <= n; ++l, ++r) {
    int tmp = 0;
    for (int i = 1; i <= m; ++i) {
      tmp += st[i].qry(l, r);
    }
    res = min(res, tmp);
  }
  return res <= k;
}
void inline print(int mid) {
  for (int l = 1, r = mid; r <= n; ++l, ++r) {
    int tmp = 0;
    for (int i = 1; i <= m; ++i) {
      tmp += st[i].qry(l, r);
    }
    if (tmp <= k) {
      for (int i = 1; i <= m; ++i) {
        cout << st[i].qry(l, r) << ' ';
      }
      cout << '\n';
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  n = read();
  m = read();
  k = read();
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      a[i][j] = read();
    }
  }
  for (int i = 1; i <= m; ++i) {
    st[i].init(i);
  }
  int l = 0, r = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (chk(mid)) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  print((l + r) >> 1);
}
