#include <bits/stdc++.h>
using namespace std;
string st[1000010];
vector<pair<int, int> > cat[1000010];
int start[1000010], nxt[1000010], o[1000010];
int sum[1000010];
int main() {
  int n, r, c, ok = 0, ans = 0, po = 0;
  cin >> n >> c >> r;
  for (int i = 0; i < n; i++) {
    cin >> st[i];
    int l = st[i].length();
    sum[i] = l;
    if (i) sum[i] += sum[i - 1];
    if (l > r) {
      if ((int)cat[ok].size()) {
        for (int i = 1; i < cat[ok].size(); i++) {
          cat[ok][i].first += cat[ok][i - 1].first;
        }
        ok++;
      }
      continue;
    }
    cat[ok].push_back(make_pair(l, i));
  }
  if (ok) ans = 1, po = cat[0][0].second;
  for (int i = 0; i < ok; i++) {
    for (int j = 0; j < cat[ok].size(); j++) start[j] = j, o[j] = 0;
    for (int j = 1; j < cat[ok].size(); j++) {
      int p = lower_bound(cat[i].begin(), cat[i].end(),
                          make_pair(cat[i][j].first - r, cat[i][j].second)) -
              cat[i].begin();
      nxt[p] = i;
      o[j] = o[p] + 1;
      start[j] = min(start[j], start[p]);
      if (o[j] > c) {
        start[j] = nxt[start[j]];
        o[j] = c;
      }
      if (j - start[j] + 1 > ans) {
        ans = j - start[j] + 1;
        po = cat[i][start[j]].second;
      }
    }
  }
  ok = 0;
  for (int i = po, j; i < n; i = j) {
    if (ok == c) break;
    j = i;
    while (j < n && sum[j] - (i ? sum[i - 1] : 0) <= r)
      cout << st[j] << ' ', j++;
    ok++;
    puts("");
  }
  while (ok < c) puts(""), ok++;
  return 0;
}
