#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<string>
#include<iostream>
using namespace std;
int next[1010000];
int prev[1010000];
string s[1010000];
int len[1010000];
int sumcnt[1010000];
int linecnt[1010000];
int lastest[1010000];
int dp[1010000][22];
int main(){
    int n,r,c;
    cin >> n >> r >> c;
    for(int i=0;i<n;i++){
        cin >> s[i];
        len[i]=s[i].size();
    }
    int l=0;
    int sum=0;
    for(int i=0;i<n;i++){
        if(l<i){
            l=i;
            sum=0;
        }
        if(len[i]>c){
            next[i]=i;
            sum=0;
            l=i;
            continue;
        }
        while(1){
            if(l>=n)break;
            int toAdd=0;

            if(sum!=0)toAdd=1;
            toAdd+=len[l];
            if(sum+toAdd<=c){
                sum+=toAdd;
                l++;
            }
            else break;
        }
        next[i]=l;
        if(sum>0){
            sum-=len[i];
            if(sum>0)sum--;
        }
    }
    for(int i=0;i<n;i++)dp[i][0]=next[i];
    for(int k=1;k<=20;k++){
        for(int i=0;i<n;i++)
        dp[i][k]=dp[ dp[i][k-1] ] [k-1];
    }
    int ans=0;
    int ansat=-1;
    for(int i=0;i<n;i++){
        int rem=r;
        int now=i;
        for(int l=20;l>=0;l--){
            if(rem>= (1<<l) ){
                rem-=(1<<l);
                now=dp[now][l];
            }
        }
        if(now-i>ans){
            ans=now-i;
            ansat=i;
        }
    }
    int cnt=0;
    for(int i=ansat;i<ansat+ans;i++){
        if(cnt==0){
            cnt+=len[i];
            cout << s[i];
        }
        else if(cnt+len[i]+1<=c){

            cnt+=len[i]+1;
            cout << " " <<s[i];
        }
        else{
            cout << endl;
            cnt=len[i];
            cout << s[i];
        }
    }
}
/*
9 1 9
this is a sample textxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx for croc final round


*/
