#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 10;
int n, r, c, l[N], p[20][N];
char s[5 * N];
long long f[N];
string w[N];
int main() {
  scanf("%d %d %d", &n, &r, &c);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    w[i] = s;
    l[i] = strlen(s);
  }
  f[0] = 0;
  for (int i = 0; i < n; i++) {
    f[i + 1] = f[i] + l[i];
  }
  for (int i = 0, j = 0; i <= n; i++) {
    while (j <= n && f[j] - f[i] + j - i - 1 <= c) {
      j++;
    }
    p[0][i] = j - 1;
  }
  for (int j = 1; j < 20; j++) {
    for (int i = 0; i <= n; i++) {
      p[j][i] = p[j - 1][p[j - 1][i]];
    }
  }
  pair<int, int> ans = {1, 0};
  if (n == 864696) {
    for (int i = 0; i <= 19; ++i) printf("%d ", p[i][269561]);
    printf("\n");
  }
  for (int i = 0; i < n; i++) {
    int at = i;
    int hcy = 0;
    if (n == 864696 && i == 269561) hcy = 1;
    for (int j = 19; j >= 0; j--) {
      if ((r & (1 << j)) != 0) {
        if (hcy == 1) printf("%d %d %d\n", j, at, p[j][at]);
        at = p[j][at];
      }
    }
    if (at == i) {
      continue;
    }
    if (at - i + 1 > ans.second - ans.first + 1) {
      ans.first = i;
      ans.second = at;
    }
  }
  if (n == 864696) return 0;
  int at = ans.first;
  while (at < ans.second) {
    int nxt = p[0][at];
    for (int j = at; j < nxt; j++) {
      if (j != at) {
        printf(" ");
      }
      printf("%s", w[j].c_str());
    }
    puts("");
    at = nxt;
  }
  return 0;
}
