#include <cassert>
#include <cstdio>

#include <iostream>
#include <string>
using namespace std;

const int MAX_N = 1000000;

int n, r, c;
string words[MAX_N + 1];
int sum[MAX_N + 1];
int next[MAX_N + 1];
bool vis[MAX_N + 1];
int best, start;

void read() {
#ifndef ONLINE_JUDGE
    assert(freopen("date.in", "r", stdin));
    assert(freopen("date.out", "w", stdout));
#endif
    cin.sync_with_stdio(false);
    cin >> n >> r >> c;
    for (int i = 1; i <= n; ++i)
        cin >> words[i];
}

void check_best(int word_cnt, int i) {
    if (word_cnt > best) {
        best = word_cnt;
        start = i;
    }
}

void solve() {
    // partial sums over words' length
    for (int i = 1; i <= n; ++i)
        sum[i] = sum[i - 1] + words[i].length();

    int p = 1;
    for (int i = 1; i <= n; ++i) {
        while (p <= n && (sum[p] - sum[i - 1] + (p - i)) <= c)
            ++p;
        next[i] = p;
    }

    for (int left = 1; left <= n; ++left) {
        if (vis[left]) break;
        vis[left] = true;

        int word_cnt = 0;
        int i = left, j = left;
        for (int stp = 1; stp <= r; ++stp) {
            word_cnt += next[j] - j;
            j = next[j];
        }
        check_best(word_cnt, i);

        while (i != j) {
            // move left pointer
            word_cnt -= next[i] - i;
            i = next[i];
            vis[i] = true;

            // move right pointer
            if (j != n + 1) {
                word_cnt += next[j] - j;
                j = next[j];
            }

            check_best(word_cnt, i);
        }
    }
}

void print() {
    if (start == 0) return;
    for (int i = 1; i <= r; ++i) {
        if (next[start] == start) return;

        cout << words[start];
        for (int j = start + 1; j < next[start]; ++j)
            cout << " " << words[j];
        cout << "\n";

        start = next[start];
    }
}

int main() {
    read();
    solve();
    print();
}
