#include <bits/stdc++.h>
using namespace std;
char s[5000005];
int len[1000005];
int idx[1000005];
int sum[1000005];
int sz = 0;
int dp[1000005];
int ds[1000005];
int p[1000005];
int last[1000005];
int main() {
  int n, r, c;
  scanf("%d%d%d", &n, &r, &c);
  gets(s);
  gets(s);
  int cnt = 0, slen = 0;
  for (int i = 0; s[i]; i++, slen++) {
    if (s[i] == ' ' && cnt != 0) {
      len[sz] = cnt;
      idx[sz++] = i - cnt;
      cnt = 0;
    } else
      cnt++;
  }
  if (cnt > 0) {
    len[sz] = cnt;
    idx[sz++] = slen - cnt;
    cnt = 0;
  }
  sum[0] = len[0];
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + 1 + len[i];
  for (int i = n - 1; i >= 0; i--) {
    int id = upper_bound(sum, sum + n, (i > 0 ? sum[i - 1] + 1 : 0) + c) - sum;
    if (id > n) id = n;
    if (id > i) {
      if (ds[id] < r) {
        ds[i] = ds[id] + 1;
        dp[i] = dp[id] + (id - i);
        p[i] = id - i;
        if (last[id] == 0) last[id] = i;
      } else {
        ds[i] = r;
        dp[i] = (id - i) + dp[id] - p[last[id + dp[id]]];
        p[i] = id - i;
        if (last[id] == 0) last[id] = i;
      }
    }
  }
  int maid = 0;
  for (int i = 0; i < n; i++) {
    if (dp[i] > dp[maid]) maid = i;
  }
  int cn = 1, cs = p[maid];
  for (int i = maid; i < maid + dp[maid]; i++) {
    s[idx[i] + len[i]] = 0;
    if (cn < cs) {
      printf("%s ", s + idx[i]);
      cn++;
    } else {
      printf("%s\n", s + idx[i]);
      cs = p[i + 1];
      cn = 1;
    }
  }
  return 0;
}
