#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n, r, c, a[N];
string s[N];
struct edge {
  int to, nx;
} ee[N];
int eq[N], en = 1;
int root[N], sta[N], top;
int ss, tt;
void link(int u, int v) {
  if (u == v)
    root[u] = 1;
  else
    ee[++en] = (edge){v, eq[u]}, eq[u] = en;
}
void upd(int s, int t) {
  if (t - s > tt - ss) {
    ss = s;
    tt = t;
  }
}
void dfs(int go) {
  sta[top = 1] = go;
  while (top) {
    int u = sta[top];
    if (!eq[u]) {
      int v = sta[max(top - r, 1)];
      upd(u, v);
      --top;
    } else {
      sta[++top] = ee[eq[u]].to;
      eq[u] = ee[eq[u]].nx;
    }
  }
}
int main() {
  scanf("%d %d %d", &n, &r, &c);
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
    a[i] = s[i].length();
  }
  link(n + 1, n + 1);
  for (int i = n, j = i, tot = 0; i >= 1; --i) {
    tot += a[i] + (i != j);
    while (tot > c) {
      tot -= a[j] + (i != j);
      --j;
    }
    link(j + 1, i);
  }
  for (int i = n + 1; i >= 1; --i) {
    if (root[i]) dfs(i);
  }
  for (int i = ss, tot = 0; i < tt; ++i) {
    if (tot + (tot > 0) + a[i] > c) {
      putchar('\n');
      tot = 0;
    }
    if (tot != 0) putchar(' ');
    cout << s[i];
    tot += (tot > 0) + a[i];
  }
}
