#include <bits/stdc++.h>
using namespace std;
const int max_n = 1000000;
const int max_lgr = 20;
const int max_char = 5000000 + max_n;
int n, r, c;
char *str[max_n];
int pos[max_n + 1], nxt[max_lgr + 1][max_n + 1];
char buf[max_char + 1] = {0};
int main() {
  scanf("%d %d %d", &n, &r, &c);
  char *ptr = buf;
  for (int i = 0; i < n; i++) {
    str[i] = ptr;
    scanf("%s", ptr);
    while (*ptr) ptr++;
    ptr++;
  }
  pos[n] = ptr - buf;
  for (int i = 0; i < n; i++) pos[i] = str[i] - buf;
  nxt[0][n] = n;
  for (int i = 0; i < n; i++)
    nxt[0][i] = upper_bound(pos, pos + n + 1, pos[i] + c + 1) - pos - 1;
  for (int i = 0; i < max_lgr; i++)
    for (int j = 0; j <= n; j++) nxt[i + 1][j] = nxt[i][nxt[i][j]];
  int ans = -1, lb;
  for (int st = 0; st < n; st++) {
    int ed = st;
    for (int i = 0; i < max_lgr; i++)
      if ((1 << i) & r) ed = nxt[i][ed];
    if (ans < ed - st) {
      ans = ed - st;
      lb = st;
    }
  }
  assert(ans >= 0);
  for (int i = 0; i < r; i++) {
    for (int j = lb; j < nxt[0][lb]; j++) printf(" %s" + (j == lb), str[j]);
    printf("\n");
    lb = nxt[0][lb];
  }
  return 0;
}
