#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
using namespace std;
const int Maxn=1000005;
int n,r,c,len[Maxn],next[Maxn],jump[Maxn];
char str[Maxn*5],*cur_s=str,*s[Maxn];

void print(char *s,int len) {
	for (int i=0;i<len;i++) putchar(s[i]);
}

int main() {
	scanf("%d%d%d",&n,&r,&c);
	for (int i=1;i<=n;i++) {
		scanf("%s",s[i]=cur_s);
		cur_s+=len[i]=strlen(cur_s);
	}
	for (int i=1,j=0,now_len=-1;i<=n;i++) {
		while (j<n&&now_len+len[j+1]<c) now_len+=len[++j]+1;
		next[i]=jump[i]=j;
		now_len-=len[i]+1;
	}
	next[n+1]=n;
	for (--r;r;r>>=1)
		for (int x=n;x>=1;x--) {
			if (r&1) jump[x]=next[jump[x]+1];
			next[x]=next[next[x]+1];
		}
	int maxv=-1,w=0;
	for (int i=1;i<=n;i++)
		if (jump[i]-i+1>=maxv) maxv=jump[i]-i+1,w=i;
	for (int i=w,now_len=-1;i<=jump[w];i++) {
		if (now_len+len[i]<c) {
			if (now_len!=-1) putchar(' ');
			print(s[i],len[i]);
			now_len+=len[i]+1;
		}
		else now_len=len[i],putchar('\n'),print(s[i],len[i]);
	}
	return 0;
}
