#include <bits/stdc++.h>
const int N = 1000010;
const int M = 100010;
const int inf = 1061109567;
const double eps = 1e-10;
const double dinf = 1e10;
const double Pi = 3.14159265358;
using namespace std;
char s[N];
int a[N], b[N], p[N], loc[N];
bool vis[N];
int n, r, c;
int main() {
  scanf("%d%d%d", &n, &r, &c);
  getchar();
  gets(s);
  int top = 1, len = strlen(s);
  s[len] = ' ';
  s[len + 1] = 0;
  int i = 0;
  while (i < len) {
    int tmp = 0;
    loc[top] = i;
    while (s[i] != ' ') {
      i++;
      tmp++;
    }
    a[top] = tmp;
    top++;
    i++;
  }
  a[top] = 0;
  loc[top] = len;
  for (int i = 1; i <= top - 1; i++) {
    if (a[i] <= c)
      b[i] = 1;
    else
      continue;
    int rest = c - a[i];
    int cnt = i + 1;
    while (cnt < top && rest >= a[cnt] + 1) {
      b[i]++;
      rest -= a[cnt] + 1;
      cnt++;
    }
  }
  int ans = 0, begining = 0, ending = 0;
  for (int i = 1; i <= top - 1; i++) {
    if (b[i] == 0) continue;
    int cnt = i;
    int nxt = 1;
    p[0] = i;
    if (!vis[i])
      while (cnt < top) {
        if (b[cnt] == 0) break;
        vis[cnt] = 1;
        cnt += b[cnt];
        p[nxt++] = cnt;
      }
    else
      continue;
    if (nxt - 1 < r)
      if (ans < p[nxt - 1] - p[0]) {
        ans = (p[nxt - 1] - p[0]);
        begining = p[0];
        ending = p[nxt - 1];
      }
    for (int j = r; j <= nxt - 1; j++)
      if (ans < p[j] - p[j - r]) {
        ans = (p[j] - p[j - r]);
        begining = p[j - r];
        ending = p[j];
      }
  }
  int pr = begining;
  while (pr < ending) {
    for (int j = loc[pr]; j <= loc[pr + b[pr]] - 1; j++) printf("%c", s[j]);
    printf("\n");
    pr += b[pr];
  }
  return 0;
}
