#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 5;
int n, r, c, o, ans = -1;
string word[N];
int sum[N], f[N], d[N], p[N];
vector<int> e[N];
void dfs(int u, int k) {
  if (k - u > ans) {
    ans = k - u;
    o = u;
  }
  for (vector<int>::iterator j = e[u].begin(); j != e[u].end(); j++) {
    int v = *j;
    p[u] = v;
    dfs(v, d[v] - d[k] <= r ? k : p[k]);
  }
}
int main() {
  cin >> n >> r >> c;
  for (int i = 1; i <= n; i++) {
    cin >> word[i];
    sum[i] = sum[i - 1] + word[i].size() + 1;
  }
  c++;
  for (int i = 1, j = 1; i <= n + 1; i++) {
    for (; j < n + 1 && sum[j] - sum[i - 1] <= c; j++)
      ;
    f[i] = j;
    if (j > i) e[j].push_back(i);
  }
  for (int i = n + 1; i >= 1; i--) d[i] = d[f[i]] + 1;
  for (int i = 1; i <= n + 1; i++)
    if (f[i] == i) dfs(i, i);
  if (ans == -1) return 0;
  for (int i = 0; i < r; i++) {
    for (int j = o; j < f[o]; j++) cout << word[j] << " \n"[j + 1 == f[o]];
    o = f[o];
  }
}
