#include <bits/stdc++.h>
using namespace std;
char s[6000065];
int n, root, r, c, a[6000065], dp[1000005][21], pw[22], st[1000055];
int main() {
  pw[0] = 1;
  for (int i = 1; i <= 20; i++) pw[i] = pw[i - 1] * 2;
  scanf("%d%d%d", &n, &r, &c);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + root);
    st[i] = root;
    for (int j = root; j < root + strlen(s + root); j++) a[j] = i - 1;
    a[root + strlen(s + root) - 1] = i;
    root += strlen(s + root) + 1;
    a[root - 1] = i;
  }
  dp[n + 1][0] = n + 1;
  for (int i = 1; i < n; i++) {
    if (st[i] + c - 1 >= root)
      dp[i][0] = n + 1;
    else
      dp[i][0] = a[st[i] + c - 1] + 1;
  }
  for (int i = 1; i < 20; i++)
    for (int j = 1; j <= n + 1; j++) dp[j][i] = dp[dp[j][i - 1]][i - 1];
  int ans = 0, ans1 = 0;
  for (int i = 1; i <= n; i++) {
    int t = i;
    for (int j = 0; j < 20; j++)
      if (r & pw[j]) t = dp[t][j];
    if (ans < t - i || !ans1) {
      ans = t - i;
      ans1 = i;
    }
  }
  for (int i = 1; i <= r; i++) {
    int t = a[st[ans1] + c];
    if (st[ans1] + c >= root) t = n;
    for (int j = ans1; j < t; j++) printf("%s ", s + st[j]);
    printf("%s\n", s + st[t]);
    ans1 = t + 1;
    if (ans1 >= n) break;
  }
}
