#include <bits/stdc++.h>
using namespace std;
const int N = 1000007;
string word[N];
int f[N], a[N];
int g[N];
int n, r, c;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> r >> c;
  c++;
  for (int i = 1, _ = n; i <= _; i++)
    cin >> word[i], a[i] = word[i].length() + 1;
  int ans = 0, p = 1;
  for (int i = n, j = n, s = 0; i; i--) {
    s += a[i];
    while (s > c) s -= a[j--];
    f[i] = i <= j ? j : 0;
  }
  f[n + 1] = g[n + 1] = n;
  for (int i = 1, _ = n; i <= _; i++) g[i] = f[i];
  int tr = r - 1;
  while (tr) {
    if (tr & 1)
      for (int i = 1, _ = n; i <= _; i++) f[i] = g[f[i] + 1];
    for (int i = 1, _ = n; i <= _; i++) g[i] = g[g[i] + 1];
    tr >>= 1;
  }
  for (int i = 1, _ = n; i <= _; i++)
    if (f[i] - i > ans) ans = f[i] - i, p = i;
  for (int cnt = 1, _ = r; cnt <= _; cnt++) {
    int s = 0;
    while (p <= n && s + a[p] <= c) {
      if (s) cout << " ";
      s += a[p], cout << word[p++];
    }
    if (s) cout << "\n";
    if (p > n) break;
  }
  return 0;
}
