#include<bits/stdc++.h>



using namespace std;

const int maxn = 1e6+10;

string st[maxn];

int sum[maxn], next[maxn][20];



int main() {

	int n, r, c, l, i, j, p, ans, po;

	cin >> n >> r >> c;

	for( i = 1; i <= n; i ++ ) {

		cin >> st[i];

		l = st[i].length();

		sum[i] = sum[i-1] + l;

	}

	p = 0;

	for( i = 1; i <= n; i ++ ) {

		p = max( p, next[i-1][0] );

		while( p <= n && sum[p] - sum[i-1] + p - i <= c ) p++;

		next[i][0] = p;

	}

	for( i = 1; i < 20; i ++ ) {

		for( j = 1; j <= n; j ++ ) {

			next[j][i] = next[next[j][i-1]][i-1];

		}

	}

	ans = 0;

	for( i = 0; i < 20; i ++ ) next[n+1][i] = n + 1;

	for( i = 1; i <= n; i ++ ) {

		p = i;

		for( j = 0; j < 20; j ++ ) 

			if( r & ( 1 << j ) ) p = next[p][j];

		if( ans < p - i ) {

			ans = p - i;

			po = i;

		}

	}

	if( !ans ) return 0;

	for( i = po; r-- && i <= n; i = j ) {

		po = next[i][0];

		if( po == i ) return 0;

		cout << st[i];

		for( j = i + 1; j <= n && j < po; j ++ ) cout << ' ' << st[j];

		puts("");

	}

	return 0;

}
                               