#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <cmath>
#include <ctime>
#include <climits>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <map>
#include <utility>
#include <algorithm>
#include <numeric>
#include <functional>

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forl(i, n) for (int i = 1; i <= int(n); i++)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i, l, r) for(int i = int(l); i <= int(r); i++)
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define mp(x, y) make_pair((x), (y))
#define ft first
#define sc second
#define x first
#define y second

using namespace std;

template<typename X> inline X abs(const X& a) { return a < 0 ? -a : a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9;
const ld PI = acos(-1);

const int N = 5 * 1000 * 1000 + 13;

int n, r, c;
string s[N];
char buf[N];
int a[N];
int prev[N];
int next[N];

inline bool read()
{
    if (scanf("%d%d%d", &n, &r, &c) != 3)
        return false;

    forn(i, n)
    {
        assert(scanf("%s", buf) == 1);
        s[i] = string(buf);
        a[i] = sz(s[i]) + 1;
    }
    c++;

    return true;
}

void prepare ()
{
    next[n] = prev[n] = n;
    
    int rg = n - 1, sum = 0;

    ford(lf, n)
    {
        sum += a[lf];
        while (sum > c) sum -= a[rg--];
        next[lf] = rg + 1;
        prev[rg + 1] = lf;
    }    
}

int d[N];
int cntr[N];

inline void solve()
{
    prepare();

    /*forn(i, n) cerr << i << ' ' << a[i] << endl; cerr << endl;
    forn(i, n) cerr << i << ' ' << next[i] << endl; cerr << endl;
    forn(i, n) cerr << i << ' ' << prev[i] << endl; cerr << endl;*/

    int ansVal = 0, ansPos = 0;
    
    ford(i, n)
    {
        if (next[i] == i) continue;
        
        int idx = next[i];
        if (next[idx] == idx)
            d[i] = idx - i, cntr[i] = 1;
        else if (cntr[idx] < r)
        {
            cntr[i] = cntr[idx] + 1;
            d[i] = d[idx] + idx - i;
        } else
        {
            assert(cntr[idx] == r);
            cntr[i] = r;
            int idx2 = idx + d[idx];
            d[i] = max(prev[idx2], idx) - i;
        }
        
        //cerr << d[i] << endl;
        
        if (d[i] > ansVal) ansVal = d[i], ansPos = i;
    }

    int start = ansPos, fin = ansPos + ansVal - 1;

    int rem = c;
    bool fir = true;

    fore(i, start, fin)
    {
        if (sz(s[i]) + 1 > rem)
        {
            rem = c;
            puts("");
            fir = true;
        }

        rem -= sz(s[i]) + 1;
        if (!fir) putchar(' ');
        fir = false;
        printf("%s", s[i].c_str());
    }
    
    puts("");
}

int main()
{
    //assert(freopen("input.txt", "rt", stdin));
    //assert(freopen("output.txt", "wt", stdout));

    assert(read());
    solve();

    return 0;
}