import java.io.*;

import static java.lang.Math.*;
import java.util.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) {
		if(new File("input.txt").exists())
			try {
				System.setIn(new FileInputStream("input.txt"));
			} catch (FileNotFoundException e1) {
				e1.printStackTrace();
			}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "kek", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		Locale.setDefault(Locale.US);
		solve();
		in.close();
		out.close();
	}

	int n, r, c;
	String words[];
	int next[], prev[];
	long len[], sum[];
	int checkWord = -1;
	int ansStart = -1, ansEnd = -1;
	void updateAns(Queue qu){
		if(qu.size() > 0)
			updateAns(qu.last(), next[qu.first()] - 1, qu.first());
	}
	void updateAns(int start, int end, int cw){
		boolean upd = false;
		if(ansStart == -1){
			upd = true;
		}
		if((ansEnd - ansStart) < (end - start)){
			upd = true;
		}
		if (upd){
//			System.err.println("NCVLASKJF " + start + " " + end);
			ansStart = start;
			ansEnd = end;
			checkWord = cw;
		}
	}
	
	
	class Queue{
		int m[];
		int h, t;
		public Queue(int sz) {
			m = new int[sz];
		}
		int size(){
			return t - h;
		}
		void push(int x){
//			System.err.println("push " + x);
			m[t++] = x;
		}
		int pop(){
//			System.err.println("pop " + m[h]);
			return m[h++];
		}
		int len(){
			return 1 + (h == t ? 0 : Math.abs(m[h] - m[t - 1]));
		}
		int first(){
			return m[h];
		}
		int last(){
			return m[t - 1];
		}
		public void clear() {
			h = t = 0;
		}
	}
	
	boolean used[];
	
	void solve() throws IOException{
		n = nextInt();
		r = nextInt();
		c = nextInt();
		words = new String[n];
		used = new boolean[n];
		next = new int[n];
		prev = new int[n];
		len = new long[n];
		sum = new long[n];
		fill(prev, -1);
		fill(next, -1);
		
		for(int i = 0; i < n; i++){
			words[i] = nextToken();
			len[i] = words[i].length();
			if(len[i] > c)
				len[i] += 10000000;
			sum[i] = len[i];
			if(i != 0) sum[i] += sum[i - 1];
		}
		
		for(int i = 0; i < n; i++){
			int le = i;
			int ri = n - 1;
			int best = -1;
			while(le <= ri){
				int mid = (le + ri) >> 1;
				if (can(i, mid)) {
					le = mid + 1;
					best = max(best, mid);
				} else {
					ri = mid - 1;
				}
			}
			if(best == -1) continue;
			next[i] = best + 1;
			best = min(n - 1, best + 1);
			if(i == best) continue;
//			System.err.println(i + " -> " + best + " | " + words[i] + " " + words[best]);
			if(prev[best] == -1 || prev[best] > i)
				prev[best] = i;
		}
		
		Queue qu = new Queue(n + 1);
		
		for(int sv = n - 1; sv >= 0; sv--){
			if(used[sv]) continue;
			
			qu.clear();
//			System.err.println("start " + sv);
			int v = sv;
			while(v != -1){
				used[v] = true;
//				System.err.println("here " + v);
				qu.push(v);
				while(qu.size() > r) qu.pop();
//				System.err.println("upd " + qu.size() + " " + qu.len());
				updateAns(qu);
				v = prev[v];
			}
		}
		
		
		
		ArrayList<String> ans = new ArrayList<String>();
		
//		System.err.println(ansStart + " " + ansEnd + " | " + checkWord);
		if(checkWord != -1){
			int col = 0;
			int curW = checkWord;
			StringBuffer sb = new StringBuffer();
			
			while(curW >= ansStart){
				int rest = c - col;
				if(curW == n || (col == 0 && rest < len[curW]) || (col != 0 && rest < len[curW] + 1)){
					col = 0;
					ans.add(sb.toString());
					checkWord = prev[checkWord];
					curW = checkWord;
					sb = new StringBuffer();
					continue;
				}
				if(col != 0){
					sb.append(' ');
					col++;
				}
				sb.append(words[curW]);
				col += len[curW++];
			}
		}
		for(int i = ans.size() - 1; i >= 0; i--)
			out.println(ans.get(i));
			
		
	}
	
	boolean can(int from, int to){
		long sz = to - from + sum[to] - (from == 0 ? 0 : sum[from - 1]);
		return sz <= c;
	}
	
	
	
	String nextToken() throws IOException{
		while(!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	long nextLong() throws IOException{
		return Long.parseLong(nextToken());
	}
	int nextInt() throws IOException{
		return Integer.parseInt(nextToken());
	}
	double nextDouble() throws IOException{
		return Double.parseDouble(nextToken());
	}
}
