#include <bits/stdc++.h>
using namespace std;
char st[6 * 1000005];
int m = 0, c = 0;
int n, b, l[1000005], r[1000005], f[20][1000005];
int main() {
  int i, j, x, len = 0, fir = 0, sec = -1;
  scanf("%d %d %d\n", &n, &b, &c);
  while (1) {
    st[++m] = getchar();
    if (st[m] == '\n') break;
    if (st[m] == '\r') break;
    if (st[m] == EOF) break;
  }
  st[m] = ' ';
  for (i = j = 1; i <= n; i++) {
    l[i] = j;
    for (; j <= m && st[j] != ' '; j++)
      ;
    r[i] = j - 1, j++;
  }
  len = 0;
  for (i = j = 1; i <= n; i++) {
    for (; len + r[j] - l[j] + 1 <= c && j <= n; j++) len += r[j] - l[j] + 2;
    f[0][i] = j;
    if (j == i) {
      len = -1, j++;
      f[0][i] = 0;
    } else
      len -= r[i] - l[i] + 2;
  }
  for (i = 1; i < 20; i++)
    for (j = 1; j <= n; j++) f[i][j] = f[i - 1][f[i - 1][j]];
  for (i = 1; i <= n; i++) {
    if (f[0][i] == i) continue;
    for (j = 19, x = i, len = 0; j >= 0; j--)
      if (f[j][x] && len + (1 << j) <= b) len += (1 << j), x = f[j][x];
    if (len >= sec - fir) fir = i, sec = x;
    if (n == 1892) cout << len << ' ' << x - i << endl;
  }
  for (i = fir; i < sec;) {
    x = f[0][i];
    while (i < x) {
      for (j = l[i]; j <= r[i]; j++) printf("%c", st[j]);
      if (i < x - 1) printf(" ");
      i++;
    }
    printf("\n");
  }
  return 0;
}
