#include <bits/stdc++.h>
using namespace std;
string s[1000100];
int n, r, c, len[1000100], to[1000100][21], ans;
void init() {
  int j = 0, l = -1;
  for (int i = 0; i < n; i++) {
    while (l <= c && j <= n) l += len[j++] + 1;
    to[i][0] = j - 1;
    l -= len[i] + 1;
  }
  to[n][0] = n;
}
void bz() {
  for (int j = 1; (1 << j) <= r; j++)
    for (int i = 0; i <= n; i++) to[i][j] = to[to[i][j - 1]][j - 1];
}
int solve(int st) {
  int temp = st, now = r;
  for (int i = 20; i >= 0; i--)
    if (now >= (1 << i)) temp = to[temp][i];
  return temp - st;
}
void out(int st) {
  int j = st, now;
  for (int i = 0; i < r; i++) {
    if (len[j] > c) break;
    cout << s[j];
    now = c - len[j];
    j++;
    while (now >= len[j] + 1 && j < n)
      now -= len[j] + 1, cout << ' ' << s[j], j++;
    cout << endl;
  }
}
int main() {
  cin >> n >> r >> c;
  for (int i = 0; i < n; i++) cin >> s[i], len[i] = s[i].size();
  init();
  bz();
  int ans = 0, st = 0;
  for (int i = 0; i < n; i++) {
    int temp = solve(i);
    if (temp > ans) ans = temp, st = i;
  }
  if (ans > 0) out(st);
  return 0;
}
