#include <bits/stdc++.h>
using namespace std;
int N, R, C;
const int MAXN = (int)1e6 + 5;
int L[MAXN];
vector<string> strs;
inline void read() {
  cin >> N >> R >> C;
  strs.resize(N);
  for (int(i) = 0; (i) < (N); ++(i)) {
    cin >> strs[i];
    L[i] = strs[i].length();
  }
  return;
}
int nums[16][MAXN];
int endval[16][MAXN];
int words[16][MAXN];
inline void init() {
  int b = 0, len = 0;
  bool nofirst = 0;
  for (int a = 0; a < N; a++) {
    words[0][a] = (a == 0) ? 0 : words[0][a - 1];
    if (a != 0) {
      len -= L[a - 1] + 1;
      words[0][a]--;
      words[0][a] = max(words[0][a], 0);
    }
    if (b < a || len < 0) {
      b = a;
      len = 0;
      nofirst = 0;
    }
    while (b < N && len + L[b] + (int)nofirst <= C) {
      len += L[b] + (int)nofirst;
      nofirst = 1;
      words[0][a]++;
      b++;
    }
    nums[0][a] = len;
    if (len == 0) {
      b++;
    }
    endval[0][a] = b;
  }
  return;
}
inline void calc() {
  for (int i = 1; R >= (1 << i); i++) {
    for (int(j) = 0; (j) < (N); ++(j)) {
      nums[i][j] = nums[i - 1][j];
      words[i][j] = words[i - 1][j];
      if (endval[i - 1][j] != N) {
        int nstart = endval[i - 1][j];
        nums[i][j] += nums[i - 1][nstart];
        words[i][j] += words[i - 1][nstart];
        endval[i][j] = endval[i - 1][nstart];
      } else {
        endval[i][j] = endval[i - 1][j];
      }
    }
  }
  return;
}
int max_take(int s, int r_left) {
  if (r_left == 0) return 0;
  int t = 0;
  for (; (1 << t) <= r_left; t++)
    ;
  t--;
  return words[t][s] + max_take(endval[t][s], r_left - (1 << t));
}
void print(int s, int r_left) {
  if (r_left == 0) return;
  for (int(i) = 0; (i) < (words[0][s]); ++(i)) {
    if (i) cout << ' ';
    cout << strs[s + i];
  }
  if (words[0][s] != 0) cout << '\n';
  if (endval[0][s] == N) return;
  print(endval[0][s], r_left - 1);
  return;
}
inline void sum() {
  int s = 0;
  int real_max = -1;
  for (int(i) = 0; (i) < (N); ++(i)) {
    int mmax = max_take(i, R);
    if (mmax > real_max) {
      s = i;
      real_max = mmax;
    }
  }
  print(s, R);
}
int main() {
  read();
  init();
  calc();
  sum();
  return 0;
}
