#include <bits/stdc++.h>
using namespace std;
char s[5000006];
int nxt[5000006];
int n, r, c;
int p[5000004];
int ap[5000006];
vector<int> v[5000005];
int getwlen(int pos) {
  int i;
  for (i = pos; s[i] != ' '; i++)
    ;
  return i - pos;
}
void pw(int loc) {
  while (s[loc] != ' ') {
    printf("%c", s[loc++]);
  }
}
vector<int> carr;
int dfs(int cnode) {
  carr.push_back(cnode);
  ap[cnode] = carr[max(0, (int)carr.size() - r - 1)];
  for (int i = 0; i < (int)v[cnode].size(); i++) {
    dfs(v[cnode][i]);
  }
  carr.pop_back();
}
vector<int> roots;
int main() {
  int i;
  cin >> n >> r >> c;
  s[0] = ' ';
  scanf(" %[^\n]", s + 1);
  n = strlen(s);
  s[n] = ' ', s[n + 1] = 0;
  nxt[n] = n;
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == ' ')
      nxt[i] = i;
    else
      nxt[i] = nxt[i + 1];
  }
  p[0] = 0;
  for (i = 1; i <= n; i++) {
    p[i] = p[i - 1];
    if (s[i] == ' ') p[i]++;
  }
  int as = -1;
  int bst = 0;
  for (i = 0; i <= n; i++) {
    if (s[i] == ' ') {
      int st = nxt[i - 1 - c];
      if (st != i)
        v[st].push_back(i);
      else
        roots.push_back(i);
    }
  }
  for (i = 0; i < (int)roots.size(); i++) dfs(roots[i]);
  for (i = 0; i <= n; i++) {
    if (s[i] == ' ') {
      if (p[i] - p[ap[i]] > bst) {
        bst = p[i] - p[ap[i]];
        as = ap[i] + 1;
      }
    }
  }
  if (as != -1) {
    int clen = 0;
    int beg = 0;
    for (i = as; r && i < n;) {
      int clen = getwlen(i);
      if (beg + clen > c) {
        beg = 0;
        r--;
        printf("\n");
        continue;
      }
      beg += clen;
      pw(i);
      if (beg + 1 <= c) {
        printf(" ");
        beg++;
      }
      i += clen + 1;
    }
  }
  return 0;
}
