#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -f;
  for (; isdigit(c); c = getchar()) x = x * 10 + (c - '0');
  return x * f;
}
inline void out(int x) {
  if (x >= 10) out(x / 10);
  putchar(x % 10 + '0');
}
string s[1000101];
int n, R, c, a[1000101], b[1000101], nex[1000101][21];
int main() {
  cin >> n >> R >> c;
  bool eef = 0;
  for (int i = (int)0; i < (int)n; i++) {
    cin >> s[i];
    if (s[i].size() <= c) eef = 1;
    a[i] = s[i].size() + 1;
  }
  if (!eef) return 0;
  b[0] = 0;
  for (int i = (int)1; i < (int)n + 1; i++) b[i] = a[i - 1] + b[i - 1];
  for (int i = (int)0; i < (int)1000011; i++) nex[i][0] = n;
  for (int i = (int)0; i < (int)n; i++) {
    int l = i, r = n + 1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (b[mid] - b[i] > c + 1)
        r = mid - 1;
      else
        l = mid + 1;
    }
    nex[i][0] = l - 1;
  }
  for (int i = (int)1; i < (int)21; i++)
    for (int j = (int)0; j < (int)n; j++) nex[j][i] = nex[nex[j][i - 1]][i - 1];
  int ans = 0, l, r;
  for (int i = (int)0; i < (int)n; i++) {
    int x = 0, y = i;
    for (int j = 20; j >= 0; j--)
      if (x + (1 << j) <= R) x += (1 << j), y = nex[i][j];
    if (y - i > ans) {
      ans = y - i;
      l = i;
      r = y;
    }
  }
  int k = 0;
  for (int i = (int)l; i < (int)r; i++) {
    cout << s[i];
    k += a[i];
    if (i == n - 1) {
      cout << endl;
      break;
    }
    if (k + a[i + 1] > c)
      k = 0, cout << endl;
    else
      cout << ' ';
  }
  return 0;
}
