#include <bits/stdc++.h>
using namespace std;
const int N = 500005, M = 1000000;
const double EPS = 1e-9;
int n, r, c, num[2000008], k[21][1000005], v[21][1000005];
string a[1000006];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> r >> c;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s += a[i];
    if (i != n) s += " ";
  }
  int cnt = 0;
  for (int i = 0; i < (int)s.size(); i++) {
    if (i == 0 || s[i] == ' ') ++cnt;
    num[i] = cnt;
  }
  cnt++;
  for (int i = (int)s.size(); i <= 2 * (int)s.size(); i++) num[i] = cnt;
  for (int i = 0; i < (int)s.size(); i++)
    if (i == 0 || s[i - 1] == ' ')
      k[0][num[i]] = num[i + c] - num[i], v[0][num[i]] = num[i + c];
  for (int j = 1; j <= 20; j++)
    for (int i = 1; i <= n; i++)
      k[j][i] = k[j - 1][i] + k[j - 1][v[j - 1][i]],
      v[j][i] = v[j - 1][v[j - 1][i]];
  int ans = 0, st = 0;
  for (int i = 1; i <= n; i++) {
    int t = r, val = 0, p = i;
    for (int j = 20; j > -1; j--)
      if (t >= (1 << j)) val += k[j][p], t -= (1 << j), p = v[j][i];
    if (val > ans) {
      ans = val;
      st = i;
    }
  }
  cnt = 0;
  for (int i = st; i < st + ans; i++) {
    if (cnt + (int)a[i].size() < c)
      cout << a[i] << " ";
    else if (cnt + (int)a[i].size() == c)
      cout << a[i];
    else {
      cnt = 0, cout << endl;
      if (cnt + (int)a[i].size() < c)
        cout << a[i] << " ";
      else if (cnt + (int)a[i].size() == c)
        cout << a[i];
    }
    cnt += (int)a[i].size() + 1;
  }
  return 0;
}
