#include <bits/stdc++.h>
using namespace std;
string a[1100000];
int l[1100000];
int f[1100000][25];
int g[1100000];
int cf[25];
int main() {
  cf[0] = 1;
  for (int i = 1; i < 25; i++) cf[i] = cf[i - 1] * 2;
  int n, r, c;
  cin >> n >> r >> c;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    l[i] = a[i].length();
  }
  int t = -1;
  int j = -1;
  for (int i = 0; i < n; i++) {
    while (t <= c && j < n) {
      j++;
      t += l[j] + 1;
    }
    f[i][0] = j - i;
    t -= l[i] + 1;
  }
  f[n][0] = 0;
  for (int i = 1; i < 25; i++)
    for (int j = 0; j <= n; j++)
      f[j][i] = f[j][i - 1] + f[j + f[j][i - 1]][i - 1];
  memset(g, 0, sizeof(g));
  int maxi = 0;
  int max = 0;
  for (int i = 0; i < n; i++) {
    int t = i;
    for (int j = 0; j < 25; j++)
      if ((r & (1 << j)) != 0) {
        g[i] += f[t][j];
        t += cf[j];
      }
    if (g[i] > max) {
      max = g[i];
      maxi = i;
    }
  }
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < f[maxi][0]; j++) {
      cout << a[maxi + j];
      if (j != f[maxi][0] - 1) cout << " ";
    }
    cout << endl;
    maxi += f[maxi][0];
  }
  return 0;
}
