#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline string get() {
  char ch[2000010];
  scanf("%s", ch);
  return ch;
}
inline void read(int *a, int n) {
  for (int i = 0; i < n; i++) a[i] = in();
}
template <class blank>
inline void out(blank x) {
  cout << x << "\n";
  exit(0);
}
template <class blank>
inline void smin(blank &a, blank b) {
  a = min(a, b);
}
template <class blank>
inline void smax(blank &a, blank b) {
  a = max(a, b);
}
const int maxn = 5e6 + 10;
const int maxm = 1e6 + 10;
const int maxlg = 21;
const int base = 29;
const int mod = 1e9 + 7;
const long long inf = 2e18 + 10;
const int SQ = 317;
string s[maxn];
int sumlen = 0, r, sz[maxn], ri[maxn], ptr[maxn];
int32_t main() {
  int n = in(), r = in(), c = in(), cpr = r;
  for (int i = 0; i < n; i++) s[i] = get(), sz[i] = (int)s[i].size();
  ri[n] = n;
  for (int i = 0; i < n; i++) {
    ptr[i] = ri[i] = i;
    if (sz[i] > c) continue;
    if (r <= i) {
      r = i + 1;
      sumlen = sz[i];
    }
    while (r < n && sumlen + 1 + sz[r] <= c) sumlen += sz[r++] + 1;
    ri[i] = r;
    sumlen -= sz[i];
  }
  r = cpr;
  while (r) {
    if (r % 2)
      for (int i = 0; i < n; i++) ptr[i] = ri[ptr[i]];
    for (int i = 0; i < n; i++) ri[i] = ri[ri[i]];
    r /= 2;
  }
  int id = -1;
  for (int i = 0; i < n; i++)
    if (id == -1 || ptr[i] - i > ptr[id] - id) id = i;
  int left = id, right = ptr[id] - 1;
  while (left <= right) {
    sumlen = sz[left];
    cout << s[left++];
    while (left <= right && sumlen + sz[left] + 1 <= c) {
      sumlen += sz[left] + 1;
      cout << " " << s[left++];
    }
    cout << "\n";
  }
}
