#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, k, *a, i = 0, j = 1, sum = 0, dem = 1, tam = 0;
  bool xuat = false;
  a = new int[100000];
  string s;
  getline(cin, s);
  cin >> m >> n >> k;
  while (i < s.length()) {
    if (s[i] == ' ') {
      a[j] = i + 1;
      j++;
    }
    i++;
  }
  a[0] = 0;
  a[j] = s.length() + 1;
  for (i = 1; i <= j; i++)
    if (dem <= n) {
      sum += a[i] - a[i - 1];
      tam += a[i] - a[i - 1];
      if (sum <= k + 1 || (a[i] - a[i - 1] <= k + 1)) {
        if (sum <= k + 1) {
          cout << s.substr(tam - a[i] + a[i - 1], a[i] - a[i - 1]);
          xuat = true;
        } else if (a[i] - a[i - 1] <= k + 1) {
          dem++;
          sum = a[i] - a[i - 1];
          if (dem <= n) {
            if (dem != 1) cout << endl;
            cout << s.substr(tam - a[i] + a[i - 1], a[i] - a[i - 1]);
          }
        }
      } else {
        if (xuat == true) {
          dem++;
          cout << endl;
        }
        xuat = false;
        sum = 0;
      }
    }
}
