#include <cstdio>
#include <algorithm>
#include <map>
#include <cstdlib>
#include <cmath>
#include <string.h>
#include <vector>
#define x first
#define y second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long LL;
typedef double ld;
const int NMax= 1001000;
int N,R,C,size[NMax],sum[NMax],dp[1000005][21],jump[1000005][21],next[NMax];
vector<char> A[NMax];
char buf[NMax*5];
int main()
{
 scanf("%d%d%d",&N,&R,&C);
 for(int i=1;i<=N;i++) {
  scanf("%s",buf);
  int t=strlen(buf);
  size[i]=t;sum[i]=sum[i-1]+t;
  for(int j=0;j<t;j++)A[i].pb(buf[j]);
 }
 int y=1;
 for(int i=1;i<=N;i++) {
  if(sum[i]-sum[i-1]>C){
   next[i]=-1;
   continue;
  }
  while(y+1<=N&&(y<i||sum[y+1]-sum[i-1]+y+1-i<=C)) y++;
  next[i]=y;
 }
 //哈哈哈哈哈。。老子用倍增！
 int maxx=0,ret=-1;
 /*for(int i=N;i>=1;i--) {
  if(next[i]==-1)continue;
  dp[i] = dp[next[i]+1]+next[i]-i+1;
  if(dp[i]>maxx) {
  	maxx=dp[i];
	ret=i;
  }
 }*/
 memset(jump,-1,sizeof(jump));
 for(int i=1;i<=N;i++)
 	if(next[i]!=-1)dp[i][0]=next[i]-i+1,jump[i][0]=next[i];
 for(int i=1;i<=20;i++) {
 	for(int j=1;j<=N;j++) {
		if(jump[j][i-1]==-1) continue;
		int tmp=jump[j][i-1];
		dp[j][i]=dp[j][i-1]+dp[tmp][i-1];
		jump[j][i]=jump[tmp][i-1];
	}
 }
 for(int i=1;i<=N;i++) {
	int tmp=R,p=i,cnt=0;
 	for(int j=20;j>=0;j--) {
		if(jump[p][j]!=-1&&(1<<j)<=tmp) {
			tmp-=(1<<j);
			cnt+=dp[p][j];
			p=jump[p][j];
		}
	}
	if(cnt>maxx) {
		maxx=cnt;
		ret=i;
	}
 }
 if(N==1892)printf("%d\n",maxx);
 int p=ret;
 for(int i=1;i<=R;i++) {
	int last=next[p];
	while(p<=last) {
 	 for(int j=0;j<A[p].size();j++) printf("%c",A[p][j]);
	 if(p!=last) printf(" ");
	 else puts("");
	 p++;
	}
	if(p>N) break;
 }
    //getchar();getchar();
    return 0;
}
