#include <bits/stdc++.h>
using namespace std;
const int SIZEN = 1000010, SIZEL = 6000010;
int N, R, C;
int len[SIZEN];
int S[SIZEN];
int step[SIZEN][21] = {0};
int nxt[SIZEN] = {0};
string word[SIZEN];
int log_2(int a) {
  int ans = -1;
  while (a) {
    ans++;
    a >>= 1;
  }
  return ans;
}
void work(void) {
  int i = 1, j = 1;
  while (i <= N) {
    if (j < i) j = i;
    while (j <= N && S[j] - S[i - 1] <= C) j++;
    step[i][0] = j;
    i++;
  }
  step[N + 1][0] = N + 1;
  int m = log_2(R);
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= N; i++) {
      step[i][j] = step[step[i][j - 1]][j - 1];
    }
  }
  for (int i = 1; i <= N; i++) nxt[i] = i;
  for (int j = 0; j <= m; j++) {
    if ((R >> j) & 1) {
      for (int i = 1; i <= N; i++) nxt[i] = step[nxt[i]][j];
    }
  }
  int ans = 0, ansid = 0;
  for (int i = 1; i <= N; i++) {
    if (nxt[i] - i > ans) {
      ans = nxt[i] - i;
      ansid = i;
    }
  }
  int tot = 0;
  for (int i = ansid; i < nxt[ansid]; i++) {
    if (tot + len[i] > C) {
      printf("\n");
      tot = 0;
    } else if (tot)
      printf(" ");
    printf("%s", word[i].c_str());
    tot += len[i];
  }
}
char str[SIZEL];
void read(void) {
  scanf("%d%d%d", &N, &R, &C);
  C++;
  for (int i = 1; i <= N; i++) {
    scanf("%s", str);
    word[i] = str;
    len[i] = strlen(str) + 1;
    S[i] = S[i - 1] + len[i];
  }
}
int main() {
  read();
  work();
  return 0;
}
