#include <iostream>
#include <iomanip>
#include <sstream>

using namespace std;

int N, R, C;
string S, A[1000002];
int next[22][1000002];
int result, ri, rj;

int main()
{
    cin >> N >> R >> C;

    getline(cin, S);

    stringstream str(S);
    for (int i = 1; i <= N; ++i)
        str >> A[i];

    int sumnow = 0, now = 1;
    for (int i = 1; i <= N; ++i)
    {
        while (now <= N && sumnow + A[now].size() + (now != i) <= C)
        {
            sumnow += A[now].size() + (now != i);
            ++now;
        }
        next[0][i] = now;

        if (now != i) sumnow -= A[i].size() + (now >= i + 2);
        if (now == i) ++now;
    }
    for (int i = 0; i <= 20; ++i)
        next[i][N + 1] = N + 1;

    for (int i = 1; i <= 20; ++i)
        for (int j = 1; j <= N; ++j)
            next[i][j] = next[i - 1][next[i - 1][j]];

    for (int i = 1; i <= N; ++i)
    {
        int cannow = i;
        for (int j = 0; j < 20; ++j)
            if (R & (1 << j))
                cannow = next[j][cannow];

        if (cannow - i > result)
        {
            result = cannow - i;
            ri = i;
            rj = cannow - 1;
        }
    }

    for (int i = ri; i != rj + 1; i = next[0][i])
    {
        for (int j = i; j < next[0][i]; ++j)
        {
            cout << A[j];
            if (j != next[0][i] - 1) cout << ' ';
        }
        cout << '\n';
    }
}
