#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int n, rw, c, sum[1000005], f[22][1000005];
string word[1000005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> rw >> c;
  for (int i = 1; i <= n; i++) {
    cin >> word[i];
    sum[i] = sum[i - 1] + (int)word[i].length() + 1;
  }
  f[0][n] = n;
  for (int i = n - 1, nxt = n; i > 0; i--) {
    while (sum[nxt] - sum[i - 1] > c + 1) nxt--;
    f[0][i] = nxt;
  }
  for (int i = 1; i <= 20; i++) {
    for (int j = 1; j <= n; j++) {
      f[i][j] = f[i - 1][f[i - 1][j]];
    }
  }
  int l = 0, r = -1;
  for (int i = 1; i <= n; i++) {
    int res = i;
    for (int j = 0; j <= 20; j++) {
      if (rw & (1 << j)) res = f[j][res];
    }
    if (res - i >= r - l) {
      l = i;
      r = res;
    }
  }
  for (int i = l; i <= r; i++) {
    cout << word[i] << ' ';
  }
  cout << endl;
  return 0;
}
