#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
int n, i, j, l, r, st, R, C, mid, nxt[21][maxn], sum[maxn];
string S[maxn];
int main() {
  scanf("%d%d%d", &n, &R, &C);
  for (i = 1; i <= n; i++) {
    cin >> S[i];
    sum[i] = sum[i - 1] + S[i].length();
  }
  for (i = 1; i <= n; i++) {
    if ((int)S[i].length() > C)
      nxt[0][i] = i;
    else {
      l = i + 1, r = n;
      nxt[0][i] = n + 1;
      while (l <= r) {
        mid = (l + r) >> 1;
        if (sum[mid] - sum[i - 1] + mid - i > C) {
          nxt[0][i] = mid;
          r = mid - 1;
        } else
          l = mid + 1;
      }
    }
  }
  nxt[0][n + 1] = n + 1;
  for (i = 1; (1 << i) <= R; i++) {
    for (j = 1; j <= n + 1; j++) nxt[i][j] = nxt[i - 1][nxt[i - 1][j]];
  }
  j = 0;
  st = 0;
  for (l = 1; l <= n; l++) {
    r = l;
    for (i = 0; (1 << i) <= R; i++)
      if (R & (1 << i)) r = nxt[i][r];
    if (j < r - l) {
      st = l;
      j = r - l;
    }
  }
  for (i = 0; i < R; i++) {
    for (j = st; j < nxt[0][st]; j++) cout << S[j] << " ";
    if (st != nxt[0][st]) cout << endl;
    st = nxt[0][st];
  }
  return 0;
}
