#include <bits/stdc++.h>
using namespace std;
int n, r, c, t = 1;
int pre[1000005], _next[1000005], ans[1000005];
char s[5000005];
void dfs(int x) {
  if (!x) return;
  dfs(x >> 1);
  for (int i = 1; i <= n; i++) {
    ans[i] = ans[ans[i]];
    if (x & 1) ans[i] = _next[ans[i]];
  }
}
int main() {
  cin >> n >> r >> c;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + pre[i]);
    pre[i + 1] = pre[i] + strlen(s + pre[i]);
    s[pre[i + 1]++] = ' ';
  }
  for (int i = n + 1, j = n + 1; i; --i) {
    while (pre[j] - pre[i] > c + 1) j--;
    ans[i] = i;
    _next[i] = j;
  }
  dfs(r);
  for (int i = 2; i <= n; i++)
    if (ans[i] - i > ans[t] - t) t = i;
  for (int i = 1; i <= r; i++, t = _next[t]) {
    for (int j = pre[t]; j + 1 < pre[_next[t]]; j++) cout << s[j];
    cout << endl;
  }
  return 0;
}
