#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int fa[maxn][20], len[maxn];
char s[maxn * 5];
int N, R, C;
int f[maxn], st[maxn];
void init() {
  cin >> N >> R >> C;
  gets(s);
  gets(s);
  int i, j, k, now;
  for (i = 1, j = 0; i <= N; i++) {
    for (k = j; s[k] <= 'z' && s[k] >= 'a'; k++)
      ;
    len[i] = k - j;
    st[i] = j;
    j = k + 1;
  }
  now = -1;
  for (i = 1, j = 1; i <= N; i++) {
    j = max(j, i);
    while (j <= N && now + len[j] + 1 <= C) now += len[j] + 1, j++;
    fa[i][0] = j;
    if (j > i) now -= len[i] + 1;
  }
  for (i = 0; i < 20; i++) fa[N + 1][i] = N + 1;
  for (i = 1; i < 20; i++) {
    for (j = 1; j <= N; j++) fa[j][i] = fa[fa[j][i - 1]][i - 1];
  }
  int t;
  for (i = 1; i <= N; i++) {
    j = R;
    t = i;
    k = 0;
    while (j) {
      if (j & 1) t = fa[t][k];
      k++, j >>= 1;
    }
    f[i] = t;
  }
}
int main() {
  init();
  int i, j, k;
  int ans = 0, p;
  for (i = 1; i <= N; i++)
    if (f[i] - i > ans) ans = f[i] - i, p = i;
  if (!ans) return 0;
  k = 0;
  while (p <= N) {
    for (i = p; i < fa[p][0]; i++) {
      for (j = 0; j < len[i]; j++) printf("%c", s[st[i] + j]);
      if (i + 1 < fa[p][0]) printf(" ");
    }
    p = fa[p][0];
    puts("");
    k++;
    if (k == R) return 0;
  }
}
