#include <bits/stdc++.h>
const int MAX_SIZE = 1000000;
const int LEN = 5000000;
int p[MAX_SIZE + 10];
int n, r, c;
char str[LEN + 10];
int ext[MAX_SIZE + 10][20];
int ed[MAX_SIZE + 10];
void print(int id) {
  for (int i = p[id]; i < p[id + 1]; i++) putchar(str[i]);
}
int main() {
  scanf("%d%d%d", &n, &r, &c);
  str[0] = '\0';
  for (int i = 1; i <= n; i++) {
    p[i] = strlen(str);
    scanf("%s", str + p[i]);
  }
  p[n + 1] = strlen(str);
  int pos = 0;
  for (int i = 1; i <= n; i++) {
    while (pos < n && p[pos + 2] - p[i] + pos - i + 1 <= c) ++pos;
    ext[i][0] = pos;
  }
  for (int j = 0; j < 19; j++)
    for (int i = 1; i <= n; i++) ext[i][j + 1] = ext[ext[i][j]][j];
  int maxn = 0;
  pos = 0;
  for (int i = 1; i <= n; i++) {
    int cur = i;
    int rem = r, j = 0;
    while (rem) {
      if (rem & 1) cur = ext[cur][j];
      ++j;
      rem >>= 1;
    }
    if (cur - i + 1 > maxn) {
      maxn = cur - i + 1;
      pos = i;
    }
  }
  ed[0] = pos - 1;
  for (int i = 1; i <= r; i++) {
    ed[i] = ed[i - 1];
    while (ed[i] < n &&
           ed[i] - ed[i - 1] + p[ed[i] + 2] - p[ed[i - 1] + 1] <= c)
      ++ed[i];
  }
  for (int i = 1; i <= r; i++) {
    for (int j = ed[i - 1] + 1; j <= ed[i]; j++) {
      print(j);
      if (j < ed[i]) putchar(' ');
    }
    putchar('\n');
  }
}
