#include <bits/stdc++.h>
int f[20][1000050];
char s[6000050];
int st[1000050], ed[1000050];
int n, r, c;
int main() {
  int i, j, h, t, mid, x, ans;
  scanf("%d%d%d", &n, &r, &c);
  for (i = 1; i <= n; i++) {
    if (i == 1)
      st[i] = 1;
    else
      st[i] = ed[i - 1] + 2;
    scanf("%s", s + st[i]);
    ed[i] = st[i] + strlen(s + st[i]) - 1;
  }
  for (i = 1; i <= n; i++) {
    h = i - 1;
    t = n;
    while (h < t) {
      mid = (h + t + 1) / 2;
      if (ed[mid] - st[i] + 1 <= c)
        h = mid;
      else
        t = mid - 1;
    }
    f[0][i] = h;
  }
  for (i = 0; i <= 19; i++) f[i][n + 1] = n;
  for (i = 1; i <= 19; i++)
    for (j = 1; j <= n; j++) f[i][j] = f[i - 1][f[i - 1][j] + 1];
  ans = -1;
  for (i = 1; i <= n; i++) {
    x = i - 1;
    for (j = 19; j >= 0; j--)
      if (r & (1 << j)) x = f[j][x + 1];
    if (x - i + 1 > ans) {
      ans = x - i + 1;
      t = i;
    }
  }
  x = t;
  for (i = 1; i <= r; i++) {
    for (j = x; j <= f[0][x]; j++) {
      printf("%s", s + st[j]);
      if (j < f[0][x]) printf(" ");
    }
    printf("\n");
    x = f[0][x] + 1;
  }
  return 0;
}
