#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1001000;
int dp[NMAX];
int f[NMAX];
int back[NMAX];
int len[NMAX];
int n, r, c;
string s[NMAX];
int pfx[NMAX];
void buildf() {
  int j = 1;
  for (int i = 1; i <= n; ++i) {
    while (j <= n && pfx[j] - pfx[i - 1] - 1 <= c) {
      ++j;
    }
    f[i] = j - i;
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> r >> c;
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
  }
  pfx[0] = 0;
  for (int i = 1; i <= n; ++i) {
    back[i] = i;
    pfx[i] = pfx[i - 1] + s[i].size() + 1;
  }
  buildf();
  pair<long long, long long> best(0, 0);
  for (int i = 1; i <= n; ++i) {
    best = max(best, pair<long long, long long>(dp[i], i));
    cerr << " dp " << i << " = " << dp[i] << " " << back[i] << " " << len[i]
         << endl;
    int cur = dp[i] + f[i];
    int b = back[i];
    int l = len[i] + 1;
    if (l > r) {
      cur -= f[back[i]];
      b += f[back[i]];
      --l;
      cur -= f[back[i]];
    }
    int j = i + f[i];
    if (dp[j] < cur) {
      dp[j] = cur;
      back[j] = b;
      len[j] = l;
    }
  }
  best = max(best, pair<long long, long long>(dp[n + 1], n + 1));
  int p = back[best.second];
  for (; p < best.second; p += f[p]) {
    for (int j = p; j < p + f[p] - 1; ++j) {
      cout << s[j] << " ";
    }
    cout << s[p + f[p] - 1] << "\n";
  }
  return 0;
}
