#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 d[N];
int prev[N];
int next[N];
int sums[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]);
    }
    c++;

    return true;
}

void prepare ()
{
    {
        int lf = 0, sum = 0;

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

    {
        int rg = n - 1, sum = 0;

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

    sums[0] = a[0];
    forl(i, n - 1) sums[i] = sums[i - 1] + a[i];
}

inline void solve()
{
    prepare();

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

    int ansVal = 0, ansPos = 0;

    forn(i, n)
    {
        if (sums[i] <= r * c)
            d[i] = i + 1;
        else if (prev[i] == i)
            d[i] = -1;
        else
        {
            int idx = prev[i] - d[prev[i]] + 1;
            int idx2 = next[idx];
            if (next[idx] == idx) idx2++;
            idx2 = min(idx2, prev[i]);
            d[i] = i - idx2;
        }

        //cerr << d[i] << endl;

        if (ansVal < d[i]) ansVal = d[i], ansPos = i;
    }

    //cerr << ansVal << ' ' << ansPos << endl;

    if (ansVal == 0)
    {
        puts("");
    } else
    {
        int start = ansPos - ansVal + 1, fin = ansPos;

        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()
{
#ifdef SU2_PROJ
    assert(freopen("input.txt", "rt", stdin));
    //assert(freopen("output.txt", "wt", stdout));
#endif

    assert(read());
    solve();

    return 0;
}
