#include <bits/stdc++.h>
using namespace std;
int N, R, C, a[1000010][30], sum[1000010];
string str[1000010];
char s[5100000];
int id, mx;
int find_root(int k, int r) {
  int u = k;
  for (int i = 0; i < 30; i++) {
    if (r & (1 << i)) u = a[u][i];
  }
  return u - k;
}
int main() {
  scanf("%d%d%d", &N, &R, &C);
  int cu = 0;
  for (int i = 1; i <= N; i++) {
    cin >> str[i];
    int len = str[i].size();
    if (i > 1)
      sum[i] = len + sum[i - 1];
    else
      sum[i] = len;
  }
  for (int i = 1; i <= N; i++) {
    int ed = max(i, a[i - 1][0]);
    while (ed <= N && ed - i + sum[ed] - sum[i - 1] <= C) ed++;
    a[i][0] = ed;
  }
  for (int j = 0; j < 30; j++) a[N + 1][j] = N + 1;
  for (int j = 1; j < 30; j++)
    for (int i = 1; i <= N; i++) a[i][j] = a[a[i][j - 1]][j - 1];
  id = 1;
  mx = 0;
  for (int i = 1; i <= N; i++) {
    int cnt = find_root(i, R);
    if (mx < cnt) mx = cnt, id = i;
  }
  int tot = 0;
  if (!mx) return 0;
  while (tot < R) {
    int u = a[id][0] - 1;
    for (int i = id; i < u; i++) {
      cout << str[i] << " ";
    }
    cout << str[u] << endl;
    id = a[id][0];
    if (id >= N) break;
    tot++;
  }
  return 0;
}
