//ill hit the bottom and escape
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define rof(i,a,b) for(int (i)=(a);(i) > (b); --(i))
#define rep(i, c) for(auto &(i) : (c))
#define x first
#define y second
#define pb push_back
#define PB pop_back()
#define iOS ios_base::sync_with_stdio(false)
#define sqr(a) (((a) * (a)))
#define all(a) a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";
#define errop(a) cerr<<#a<<" = ( "<<((a).x)<<" , "<<((a).y)<<" )\n";
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define umap unordered_map
#define double long double
typedef long long ll;
typedef pair<int,int>pii;
typedef vector<int> vi;
typedef complex<double> point;
template <class T>  inline void smax(T &x,T y){ x = max((x), (y));}
template <class T>  inline void smin(T &x,T y){ x = min((x), (y));}
const int maxn = 1e6 + 100, maxl = 21;
string s[maxn];
char ch[5 * maxn];
int n, po, sum, r, c;
int f[maxn][maxl];
int main(){
	scanf("%d %d %d", &n, &r, &c);
	For(i,0,n){
		scanf("%s", ch);
		s[i] = string(ch);
	}
	For(i,0,maxn)	f[i][0] = n;
	For(i, 0, n){
		if(i && po > i - 1){
			sum -= s[i-1].size();
			if(po - (i-1) > 1)
				sum -- ;
		}
		smax(po, i);
		while(po < n && ((sum && sum + 1 + s[po].size() <= c) or (!sum && s[po].size() <= c))){
			if(sum)
				sum += 1 + s[po].size();
			else
				sum += s[po].size();
			++ po;
		}
		f[i][0] = po;
	}
	For(j,1,maxl)
		For(i,0,n)
			f[i][j] = f[f[i][j-1]][j-1];
	pii ans = {0, -1};
	For(i,0,n){
		int r = ::r;
		int v = i;
		rof(j,maxl-1,-1)
			if(r >= (1 << j))
				r -= (1 << j), v = f[v][j];
		if(v - i)
			smax(ans, pii(v - i, i));
	}
	int v = ans.y;
	if(v == -1){
		cout << endl;
		return 0;
	}
	while(r--){
		if(v == f[v][0])	continue;
		For(i, v, f[v][0]){
			printf("%s", s[i].c_str());
			if(i + 1 == f[v][0])
				puts("");
			else
				printf(" ");
		}
		v = f[v][0];
	}
	return 0;
}
