/*
 * 2.cpp
 *
 *  Created on: 2013-5-17
 *      Author: DebutantGY
 */

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <climits>
#include <cassert>
#include <string>
#include <bitset>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;

#define INF 1000000000
#define LL_INF 4000000000000000000ll
#define EPS (1e-9)

#define Lowbit(x) ((x) & (-(x)))
#define Lc(x) ((x) << 1)
#define Rc(x) (Lc(x) + 1)
#define Pow2(x) (1 << (x))
#define Contain(a, x) (((a) >> (x)) & 1)

#define Rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define Til(i, a, b) for(int i = (a); i >= (b); --i)
#define Foru(i, a, b) for(int i = (a); i < (b); ++i)
#define Ford(i, a, b) for(int i = (a); i > (b); --i)

#define It iterator
#define For(i, x) for(__typeof(x.begin()) i = x.begin(); i != x.end(); ++i)

#define Debug(x) (cerr << #x << " = " << (x) << endl)
#define Debug2(x, y) (cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << endl)

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> pii;
typedef vector<int> VI;
typedef vector<string> VS;

//inline int rand(int a, int b) { return rand() % (b - a + 1) + a; }

template <class T> inline bool Up(T &a, const T &b) { if(a < b) {a = b; return true;} return false; }
template <class T> inline bool Down(T &a, const T &b) { if(a > b) {a = b; return true;} return false; }

inline int getus() { int tmp, c; while(tmp = fgetc(stdin), tmp < '0' || tmp > '9'); tmp -= '0'; while(c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0'; return tmp; }
inline int getint() { int tmp, c, flag; while(flag = fgetc(stdin), flag != '-' && (flag < '0' || flag > '9')); if(flag == '-') tmp = 0; else tmp = flag - '0'; while(c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0'; return flag == '-' ? -tmp : tmp; }

#define MAXN 1000023

struct enode {
	int to;
	enode *next;
} ebase[MAXN], *etop = ebase, *fir[MAXN];

typedef enode *edge;

int N, R, C, L[MAXN], ind[MAXN], next[MAXN];
int res[MAXN], ansV = 0, ansF = 0;
string s[MAXN];

inline void addEdge(int a, int b) {
	++ind[b];
	etop->to = b;
	etop->next = fir[a];
	fir[a] = etop++;
}

void DFS(int x, int dep, int sum) {
	if (dep >= R) sum -= res[dep - R];
	if ( Up(ansV, sum) ) ansF = x;
	for (edge e(fir[x]); e; e = e->next) {
		int y = e->to;
		DFS(y, dep + 1, sum + x - y);
	}
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
#endif
	
	ios::sync_with_stdio(false);
	memset(fir, 0, sizeof(fir));
	memset(ind, 0, sizeof(ind));
	
	cin >> N >> R >> C;
	Rep(i, 1, N) {
		cin >> s[i];
		L[i] = s[i].size() + 1;
	}
	
	int ptr = 0, sum = -1;
	Rep(i, 1, N) {
		if (ptr < i) ptr = i, sum = -1;
		while (ptr <= N && sum + L[ptr] <= C) sum += L[ptr++];
		if (ptr != i) {
			addEdge(ptr, i);
			next[i] = ptr;
		}
		else next[i] = -1;
		sum -= L[i];
	}
	
	Rep(i, 1, N + 1) if (!ind[i])
		DFS(i, 0, 0);
	if (ansF == 0) {
		cout << endl;
		return 0;
	}
	int cnt = 0;
	for (int l = ansF; l != -1 && l <= N; l = next[l]) {
		int r = next[l] - 1;
		Rep(i, l, r) cout << s[i] << (i == r ? '\n' : ' ');
		if (++cnt >= R) break;
	}
	cout.flush();
	return 0;
}
