#include <bits/stdc++.h>
using namespace std;
int K = 21;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, r, c;
  cin >> n >> r >> c;
  vector<string> words(n);
  vector<pair<int, int> > ep(n);
  int pt = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s.size() > c) continue;
    words[i] = s;
    ep[i] = {pt, pt + s.size() - 1};
    pt += s.size() + 1;
  }
  vector<vector<int> > table(n + 1, vector<int>(K, n));
  pt = n - 1;
  for (int i = n - 1; i >= 0; i--) {
    if (!words[i].size()) {
      table[i][0] = i;
      pt = i - 1;
      continue;
    }
    while (pt >= 0 and ep[pt].second > ep[i].first + c) pt--;
    table[i][0] = pt + 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int d = 1; d < K; d++) {
      if (words[i].size())
        table[i][d] = table[table[i][d - 1]][d - 1];
      else
        table[i][d] = i;
    }
  }
  int mx = 0, s = -1;
  for (int i = 0; i < n; i++) {
    int d = r, p = i;
    for (int b = 0; d; b++) {
      if (d & 1) p = table[p][b];
      d >>= 1;
    }
    if (p - i > mx) {
      mx = p - i;
      s = i;
    }
  }
  string ans = "";
  for (int i = s; i < s + mx; i++) {
    if (ans.size() + words[i].size() > c) {
      cout << ans << '\n';
      ans = "";
    }
    ans += (ans.size() ? " " : "") + words[i];
  }
  cout << ans << '\n';
  return 0;
}
