#include <bits/stdc++.h>
using namespace std;
struct Table {
  Table(int r, int c) : rows(r), cols(c) { clear(); }
  void clear() {
    crow = 1;
    clen = 0;
    total = 0;
  }
  bool add(int len) {
    if (clen + len > cols) {
      clen = len;
      if (clen > cols) {
        return false;
      }
      crow++;
      if (crow > rows) {
        return false;
      }
    } else {
      clen += len;
    }
    total++;
    return true;
  }
  int rows, cols, crow, clen, total;
};
int main() {
  int n, r, c;
  scanf("%d%d%d ", &n, &r, &c);
  string* words = new string[n];
  int* lens = new int[n];
  char ch;
  for (int i = 0; i < (n); i++) {
    int len = 0;
    while (1) {
      scanf("%c", &ch);
      if (isalpha(ch)) {
        words[i] += ch;
        len++;
      } else {
        break;
      }
    }
    lens[i] = len;
  }
  int first = 0, last = 0;
  int maxWords = 0;
  int maxF, maxL;
  bool hit = false;
  Table table(r, c);
  while (1) {
    while (table.add(lens[last])) {
      last++;
      if (last >= n) {
        hit = true;
        break;
      }
    }
    if (table.total > maxWords) {
      maxWords = table.total;
      maxF = first;
      maxL = last - 1;
    }
    if (hit) break;
    table.clear();
    first++;
    last = first;
  }
  int tmpL = 0, newL;
  while (1) {
    newL = words[maxF].length();
    if (tmpL + newL > c) {
      printf("\n");
      tmpL = newL;
    } else {
      tmpL += newL + 1;
    }
    printf("%s", words[maxF].c_str());
    if (maxF == maxL) break;
    printf(" ");
    maxF++;
  }
  printf("\n");
  return 0;
}
