#include <bits/stdc++.h>
using namespace std;
const int NN = 1000005;
int n, r, c, sz, pp, ans, ll[NN], rr[NN], len[NN], Log[NN], f[NN][20];
char s[NN];
void read(int i) {
  char ch = getchar();
  while (ch < 'a' || ch > 'z') ch = getchar();
  while (ch >= 'a' && ch <= 'z') len[i]++, s[++sz] = ch, ch = getchar();
}
int main() {
  scanf("%d%d%d", &n, &r, &c);
  for (int i = (1); i <= (n); i++) ll[i] = sz + 1, read(i), rr[i] = sz;
  Log[0] = -1;
  for (int i = (1); i <= (r); i++) Log[i] = Log[i >> 1] + 1;
  for (int i = 1, j = 0, all = 0; i <= n; all -= len[i] + 1, f[i][0] = j, i++)
    for (; j < n && all + len[j + 1] <= c; j++) all += len[j + 1] + 1;
  for (int j = (1); j <= (Log[r]); j++)
    for (int i = (1); i <= (n); i++)
      f[i][j] = f[f[i][j - 1] == n ? i : f[i][j - 1] + 1][j - 1];
  for (int i = 1, j = 1; i <= n; i++, j = i) {
    for (int k = (Log[r]); k >= (0); k--)
      if (j <= n)
        if (r & (1 << k)) j = f[j][k] + 1;
    if (j - i > ans) ans = j - i, pp = i;
  }
  if (!pp) {
    for (int i = (1); i <= (r); i++) printf("\n");
    return 0;
  }
  for (int Time = (1); Time <= (r); Time++) {
    if (pp > n || pp > f[pp][0]) {
      for (int i = (Time); i <= (r); i++) printf("\n");
      break;
    }
    for (int i = (pp); i <= (f[pp][0]); i++) {
      for (int j = (ll[i]); j <= (rr[i]); j++) printf("%c", s[j]);
      if (i < f[pp][0])
        printf(" ");
      else
        printf("\n");
    }
    pp = f[pp][0] + 1;
  }
  return 0;
}
