#include <bits/stdc++.h>
using namespace std;
int n, r, c, a[2000000], next2[2000000], next1[2000000], d[1000100][22], ans,
    start, sum[2000000];
string str[2000000];
int main() {
  scanf("%d%d%d", &n, &r, &c);
  for (int i = 1; i <= n; i++) cin >> str[i], a[i] = str[i].length();
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  for (int i = 1; i <= n; i++) {
    int l = 0, R = i, mid, pos = i;
    while (l <= R) {
      mid = l + R >> 1;
      if (sum[i] - sum[mid] + i - mid - 1 <= c)
        R = mid - 1, pos = mid;
      else
        l = mid + 1;
    }
    next2[i] = pos;
    next1[pos + 1] = i;
  }
  for (int i = 1; i <= n; i++) d[i][0] = next2[i];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 20; j++) d[i][j] = d[d[i][j - 1]][j - 1];
  ans = 0;
  start = 0;
  for (int i = 1; i <= n; i++) {
    int tt = r, ans1 = 0, sta = 0, x = i;
    while (tt > 0) {
      int ttt = 1, tx = 0;
      while (ttt * 2 <= tt) ttt *= 2, tx++;
      ans1 += x - d[x][tx];
      sta = d[x][tx] + 1;
      tt -= ttt;
    }
    if (ans1 > ans) ans = ans1, start = sta;
  }
  int len = 0;
  for (int i = 1; i <= ans; i++) {
    if (len + str[start + i - 1].length() > c) {
      puts("");
      len = 0;
    }
    cout << str[start + i - 1] << " ";
    len += str[start + i - 1].length() + 1;
  }
  return 0;
}
