#include <bits/stdc++.h>
using namespace std;
char s[10000000];
int nxt[10000000];
int n, r, c;
int dp[10000000];
int stp[10000000];
int getwlen(int pos) {
  int i;
  for (i = pos; s[i] != ' '; i++)
    ;
  return i - pos;
}
void pw(int loc) {
  while (s[loc] != ' ') {
    printf("%c", s[loc++]);
  }
  printf(" ");
}
int main() {
  int i;
  cin >> n >> r >> c;
  s[0] = ' ';
  scanf(" %[^\n]", s + 1);
  n = strlen(s);
  s[n] = ' ', s[n + 1] = 0;
  nxt[n] = n;
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == ' ')
      nxt[i] = i;
    else
      nxt[i] = nxt[i + 1];
  }
  int as = -1;
  int bst = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == ' ') {
      int st = nxt[i - 1 - c];
      if (st >= i) {
        dp[i] = 0;
        stp[i] = i + 1;
      } else {
        dp[i] = dp[st] + 1;
        stp[i] = stp[st];
      }
    }
    if (dp[i] > bst) {
      as = stp[i];
      bst = dp[i];
    }
  }
  if (as != -1) {
    int clen = 0;
    int beg = 0;
    for (i = as; r && i < n;) {
      int clen = getwlen(i);
      if (beg + clen > c) {
        beg = 0;
        r--;
        printf("\n");
        continue;
      }
      beg += clen + 1;
      pw(i);
      i += clen + 1;
    }
  }
  return 0;
}
