#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
int j, n, k, l, q, q1, q2, a[1000001], p, i, h, t, x, d[21][1000001],
    f[1000001], m;
string s[1000001];
void tg() {
  freopen("output.txt", "r", stdin);
  freopen("input.txt", "w", stdout);
}
int main() {
  scanf("%d%d%d", &n, &k, &p);
  for (j = 1; j <= n; j++) {
    cin >> s[j];
    a[j] = s[j].size();
    f[j] = j - 1;
  }
  while (x + a[i + 1] <= p) {
    x += a[++i] + 1;
  }
  d[0][1] = i;
  for (j = 2; j <= n; j++) {
    if (x >= a[j - 1] + 1) {
      x -= a[j - 1] + 1;
    }
    i = max(d[0][j - 1], j - 1);
    if (i == n) {
      d[0][j] = i;
      break;
    }
    while (x + a[i + 1] <= p) {
      x += a[++i] + 1;
      if (i == n) {
        break;
      }
    }
    d[0][j] = i;
  }
  for (h = 1; h <= 20; h++) {
    for (j = 1; j <= n; j++) {
      if (d[h - 1][j] < n) {
        d[h][j] = d[h - 1][d[h - 1][j] + 1];
      } else {
        d[h][j] = n;
      }
    }
  }
  for (h = 0; h < 20; h++) {
    if ((k & (1 << h)) > 0) {
      for (j = 1; j <= n; j++) {
        if (f[j] == n) {
          break;
        }
        f[j] = d[h][f[j] + 1];
      }
    }
  }
  f[0] = -1;
  for (j = 1; j <= n; j++) {
    if (f[j] - j + 1 > f[q] - q + 1) {
      q = j;
    }
  }
  for (j = q; j <= n;) {
    if (d[0][j] >= j) {
      for (i = j; i < d[0][j]; i++) {
        printf("%s ", s[i].c_str());
      }
      printf("%s\n", s[i].c_str());
    } else {
      break;
    }
    k--;
    if (k == 0 || d[0][j] == n) {
      break;
    }
    j = d[0][j] + 1;
  }
  return 0;
}
