#include <bits/stdc++.h>
using namespace std;
int poz[1000010], next[1000010], urm[100010], sol[1000010];
char sir[5000010];
int main() {
  int nr, n, m;
  scanf("%d%d%d", &nr, &n, &m);
  m++;
  for (int i = 1; i <= nr; i++) {
    scanf("%s", sir + poz[i]);
    poz[i + 1] = poz[i] + strlen(sir + poz[i]);
    sir[poz[i + 1]++] = ' ';
  }
  poz[nr + 2] = 1000000000;
  for (int i = 1, j = 1; i <= nr + 1; i++) {
    while (j <= nr + 1 && poz[j] - poz[i] <= m) j++;
    next[i] = urm[i] = j - 1;
    sol[i] = i;
  }
  for (int step = 1; step <= nr; step <<= 1) {
    if (n & step)
      for (int i = 1; i <= nr; i++) sol[i] = next[sol[i]];
    for (int i = 1; i <= nr; i++) next[i] = next[next[i]];
  }
  int x = 1;
  for (int i = 1; i <= nr; i++)
    if (poz[sol[i]] - poz[i] > poz[sol[x]] - poz[x]) x = i;
  for (int i = 1; i <= n; i++) {
    for (int j = poz[x]; j < poz[urm[x]] - 1; j++) printf("%c", sir[j]);
    printf("\n");
    x = urm[x];
  }
  return 0;
}
