#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e6, mxs = 6e6, lgsz = 20;
int n, m, r, c, el, er = -1, dp[mxn + 5][lgsz + 5], fm[mxn + 5], pre[mxs + 5];
string s, dat[mxn + 5];
inline int ask(int fm) {
  for (int k = lgsz; ~k; --k)
    if (r & (1 << k)) fm += dp[fm][k];
  return fm;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> r >> c, m = 1;
  for (int i = 1; i <= n; ++i) {
    cin >> dat[i], fm[i] = m;
    m += dat[i].size() + 1, ++pre[m - 2];
  }
  for (int i = 1; i <= m; ++i) pre[i] += pre[i - 1];
  for (int i = 1; i <= n; ++i)
    dp[i][0] = pre[min(m, fm[i] + c - 1)] - pre[fm[i] - 1];
  for (int k = 1; k <= lgsz; ++k)
    for (int u = 1; u <= n; ++u) {
      int p = dp[u][k - 1];
      dp[u][k] = p + dp[u + p][k - 1];
    }
  for (int i = 1; i <= n; ++i) {
    int l = i, r = ask(i) - 1;
    if (r - l + 1 > er - el + 1) el = l, er = r;
  }
  for (int i = el, cur = 0; i <= er; cur = 0) {
    for (; i <= er and cur + dat[i].size() <= c; cur += dat[i].size() + 1, ++i)
      cout << dat[i] << ' ';
    cout << '\n';
  }
}
