#include <bits/stdc++.h>
using namespace std;
int n, r, c;
int ar[1010000];
int t[20][1010000];
int p[20][1010000];
string str[1010000];
int main() {
  int i, j = -1;
  int t = 0;
  scanf(" %d %d %d", &n, &r, &c);
  for (i = 0; i < n; i++) {
    cin >> str[i];
    ar[i] = str[i].size();
  }
  for (i = 0; i < n; i++) {
    if (j < i - 1) j = i - 1;
    if (j == i - 1) t = 0;
    while (j + 1 < n && t + (!!t) + ar[j + 1] <= c) {
      j++;
      t = t + (!!t) + ar[j];
    }
    p[0][i] = j + 1;
    t -= ar[i] + 1;
  }
  int x, k;
  int res = -1;
  int resi;
  for (i = 0; i < 20; i++) p[i][n] = n;
  for (i = n - 1; i >= 0; i--)
    for (j = 1; j < 20; j++) p[j][i] = p[j - 1][p[j - 1][i]];
  for (i = 0; i < n; i++) {
    x = i;
    for (j = 0; j < 20; j++)
      if ((1 << j) & r) x = p[j][x];
    if (x - i > res) {
      res = x - i;
      resi = i;
    }
  }
  k = resi;
  for (i = 0; i < r; i++) {
    t = 0;
    int flag = 0;
    while (k < n && t + (!!t) + ar[k] <= c) {
      t = t + (!!t) + ar[k];
      if (!flag) cout << str[k];
      if (flag) cout << " " << str[k];
      flag = 1;
      k++;
    }
    printf("\n");
  }
  return 0;
}
