#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
constexpr int N = 2e5 + 7, M = 21;
int par[M + 1][N], val[M + 1][N];
string s[N];
vector<int> v[M * 5];
int32_t main() {
  ios::sync_with_stdio(0);
  int n, r, c;
  cin >> n >> r >> c;
  for (int i = 0; i < n; i++) cin >> s[i];
  deque<int> Q;
  int sum = 0;
  for (int i = 0; i < M; i++) par[i][n] = n;
  int ANS = -1, f = -1;
  for (int i = n - 1; ~i; --i) {
    sum += ((int)s[i].size()) + 1 - (Q.empty());
    Q.push_front(i);
    while (sum > c) {
      sum -= ((int)s[Q.back()].size());
      Q.pop_back();
      sum -= 1 - Q.empty();
    }
    if (Q.empty())
      par[0][i] = n;
    else
      par[0][i] = Q.back() + 1;
    val[0][i] = ((int)Q.size());
    for (int o = 1; o < M; o++) {
      val[o][i] = val[o - 1][par[o - 1][i]] + val[o - 1][i];
      par[o][i] = par[o - 1][par[o - 1][i]];
    }
    int pos = r, ans = 0, who = i;
    for (int k = M; k >= 0; k--)
      if (pos >= (1 << k)) {
        pos -= (1 << k), ans += val[k][who], who = par[k][who];
      }
    if (ANS < ans) {
      ANS = ans;
      f = i;
    }
  }
  int a = 0, pos = 0;
  for (int i = f; i < f + ANS; i++) {
    if (a + 1 + ((int)s[i].size()) > c) pos++, a = -1;
    a += ((int)s[i].size()) + 1;
    v[pos].push_back(i);
  }
  for (int i = 0; i < r; i++) {
    for (auto j : v[i]) cout << s[j] << ' ';
    cout << endl;
  }
}
