#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
string s[N];
char str[5 * N];
int len[N], sum[N], nxt[N][21];
int main() {
  int n, r, c, i, j;
  scanf("%d%d%d", &n, &r, &c);
  for (i = 1; i <= n; i++) {
    scanf("%s", str);
    s[i] = str;
    len[i] = strlen(str);
    sum[i] = sum[i - 1] + len[i];
  }
  int rt = 0, ps = 1;
  for (i = 1; i <= n; i++) {
    if (sum[i] + i - 1 > c) break;
  }
  nxt[1][0] = i;
  int d = i;
  for (i = 2; i <= n; i++) {
    while (d <= n && sum[d] - sum[i - 1] + d - i <= c) d++;
    nxt[i][0] = d;
  }
  for (i = 0; i < 21; i++) nxt[n + 1][i] = n + 1;
  for (j = 1; j < 21; j++) {
    for (i = n; i > 0; i--) {
      nxt[i][j] = nxt[nxt[i][j - 1]][j - 1];
    }
  }
  for (i = 1; i <= n; i++) {
    int x = i;
    for (j = 20; j >= 0; j--)
      if (r & (1 << j)) {
        x = nxt[x][j];
      }
    if (rt < x - i) {
      rt = x - i;
      ps = i;
    }
  }
  for (i = 0; i < r; i++) {
    if (nxt[ps][0] == ps) break;
    for (j = ps; j < nxt[ps][0]; j++) cout << s[j] << ' ';
    puts("");
    ps = nxt[ps][0];
  }
  return 0;
}
