
//(C) Jarek Czekalski 2012-13

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <vector>

using namespace std;

// debugging stuff {{{
#ifdef DEBUG
  #define bDebug 1
  #define bDebug2 1
#else
  #define bDebug 0
  #define bDebug2 0
#endif
#define deb(a) #a << "=" << (a) << " "
#ifndef HOME
  #define assert(a) {}
#endif

template<class T> ostream& operator<<(ostream& os, vector<T> v) //{{{
{
  for(int i=0; i<v.size(); i++)
    os << v[i] << " ";
  os << endl;
  return os;
}  //}}}
// }}} end of debugging stuff

#define array(a, type, count) type *a = (type*)calloc(sizeof(type), count)
#define eps 1e-9
#define eq(a, b) ( (a) > (b) - eps && (a) < (b) + eps )
#define eraseAll(v) v.erase(v.begin(), v.end())
#define fi first
#define rep(i,n) for(long i=0; i<(n); i++)
#define rep2(i,a,b) for(long i=(a); i<=(b); i++)
#define rep2d(i,a,b) for(long i=(a); i>=(b); i--)
#define zeroMem(a) memset(a, 0, sizeof(a))
#define zeroMem2(a, n) memset(a, 0, sizeof(*a) * n)
#define fore(it,L) for(typeof(L.begin()) it=L.begin(); it!=L.end(); it++)
#define eraseAll(v) v.erase(v.begin(), v.end())
#define se second
#define setMin(a,b) { typeof(a) rv = (b); if (rv < a) a = rv; }
#define setMinP(a,b) { typeof(a) rv = (b); if (a < 0 || rv < a) a = rv; }
#define setMax(a,b) { typeof(a) rv = (b); if (rv > a) a = rv; } 
#define swap(a,b) { typeof(a) swapVar = a; a = b; b = swapVar; }
#define Int long long

//*********************** SOLUTION    ******************************
#define M1 1000005
#define M2 20
int *acw[M2+1];

main ()
{
  cin.sync_with_stdio(false);
  //ifstream cin("0.in");
  cout.sync_with_stdio(false);
  array(aLw, int, M1); // word lengths
  rep2(i, 0, M2) acw[i] = (int*)calloc(M1, sizeof(int));
  // array(acw, int, M1); // acw[i] count of words that fit on line, starting at i
  array(buf, char, 6*M1);
  array(aws, char*, M1); // word start in buf
  Int x, y, n; cin >> n >> y >> x;
  x += 1; // we will insert a space before each word
  char *pch = buf;
  rep(i, n) {
    cin >> pch;
    aLw[i] = strlen(pch) + 1;
    aws[i] = pch;
    pch += aLw[i];
  }
  Int iR = 0;
  Int L = 0;
  // iR = index of the first word not fitting on line
  rep(i, n) {
    while (L <= x && iR <= n) {
      L += aLw[iR], iR++;
    }
    iR--, L -= aLw[iR];
    assert(L >= 0);
    acw[0][i] = iR - i;
    if (bDebug) cerr << deb(aLw[i]) << deb(acw[0][i]) << deb(L) << endl;
    L -= aLw[i];
  }
  
  rep2(iPow, 1, M2) {
    rep(i, n) {
      acw[iPow][i] = acw[iPow-1][i];
      int j = i + acw[iPow][i];
      if (j < n) acw[iPow][i] += acw[iPow-1][j];
      if (bDebug) cerr << deb(iPow) << deb(i) << deb(acw[iPow][i]) << endl;
    }
  }
  
  array(ac, int, n);
  rep(i, n) {
    rep2(iPow, 0, M2) {
      if (n & (1<<iPow)) {
        int j = i + ac[i];
        if (j < n) ac[i] += acw[iPow][j];
        assert(ac[i] <= n);
      }
    }
  }
  
  int iStart = max_element(ac, ac+n) - ac;
  if (bDebug) cerr << deb(iStart) << deb(ac[iStart]) << endl;
  
  int i = iStart;
  rep(iy, y) {
    if (i >= n) break;
    rep(j, acw[0][i]) {
      if (j) cout << " ";
      cout << aws[i+j];
    }
    cout << "\n";
    i += acw[0][i];
  }
}

// :collapseFolds=1:folding=explicit:
