#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 30) - 1;
const long long linf = (1ll << 62) - 1;
const int cmax = 1e+6;
int n, r, c;
char _[6000000];
char* s[cmax];
int ln[cmax];
int wh[cmax];
const int cc = 20;
int bin[cmax][cc];
void print(int l, int r) {
  int curLine = -1;
  for (int i = l; i <= r; i++) {
    if (curLine + ln[i] + 1 > c) printf("\n"), curLine = -1;
    if (curLine != -1) printf(" ");
    printf("%s", s[i]), curLine += ln[i] + 1;
  }
  printf("\n");
}
int main() {
  assert(scanf("%d%d%d\n", &n, &r, &c));
  for (int i = 0; i < n; i++) {
    assert(scanf("%s", _));
    int size = strlen(_);
    ln[i] = size;
    s[i] = new char[size];
    memcpy(s[i], _, sizeof(char) * size);
  }
  int it = n - 1;
  int curSum = -1;
  for (int i = n - 1; i >= 0; i--) {
    curSum += ln[i] + 1;
    while (it >= i && curSum > c) curSum -= ln[it--] + 1;
    wh[i] = it + 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    bin[i][0] = wh[i];
    for (int j = 1; j < cc; j++)
      if (bin[i][j - 1] == n)
        bin[i][j] = n;
      else
        bin[i][j] = bin[bin[i][j - 1]][j - 1];
  }
  int ans = 0, lAns = -1, rAns = -2;
  for (int i = 0; i < n; i++) {
    int curC = r, v = i;
    for (int j = cc - 1; j >= 0; j--)
      if (curC >= (1 << j)) curC -= (1 << j), v = bin[v][j];
    if (v - i > ans) ans = v - i, lAns = i, rAns = v - 1;
  }
  print(lAns, rAns);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
