#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ln, lk, lm;
int a[1000005], b[1000005];
int r, c;
int ans[1000005];
bool v[1000005];
string s[1000005];
void pp(int i) {
  int cnt = 0;
  while (1) {
    for (int j = i; j < b[i]; j++) {
      cout << s[j];
      if (j == b[i] - 1)
        puts("");
      else
        printf(" ");
    }
    i = b[i];
    cnt++;
    if (i == b[i] || i > n || cnt == r) break;
  }
}
int main() {
  scanf("%d%d%d", &n, &r, &c);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    cin >> s[i];
    a[i] = a[i - 1] + s[i].length();
  }
  for (int i = 1, j = 1; i <= n; i++) {
    while (j <= n) {
      int tp = j - i + a[j] - a[i - 1];
      if (tp > c) break;
      j++;
    }
    b[i] = j;
  }
  for (int i = 1; i <= n; i++)
    if (!v[i]) {
      v[i] = 1;
      if (b[i] <= i) continue;
      int j = i;
      queue<int> vp;
      vp.push(i);
      while (!vp.empty()) {
        if (j > n) {
          int x = vp.front();
          v[x] = 1;
          ans[x] = j;
          vp.pop();
        } else {
          int jj = b[j];
          if (jj == j) {
            int x = vp.front();
            v[x] = 1;
            ans[x] = j;
            vp.pop();
          } else {
            if (vp.size() + 1 <= r) {
              vp.push(jj);
              j = jj;
            } else {
              int x = vp.front();
              v[x] = 1;
              ans[x] = jj;
              vp.pop();
              vp.push(jj);
              j = jj;
            }
          }
        }
      }
    }
  int mm = -1;
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (ans[i] > i) mm = max(mm, ans[i] - i);
  if (mm == -1) {
    return 0;
  }
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (mm == ans[i] - i) {
      pp(i);
    }
  return 0;
}
