Problem: Advertising has become part of our routine. And now, in the era of progressive technologies, we need your ideas to make advertising better!

In this problem we'll look at a simplified version of context advertising. You've got a text, consisting of exactly n words. A standard advertising banner has exactly r lines, each line can contain at most c characters. The potential customer always likes it when they can see lots of advertising, so you should determine which maximum number of consecutive words from the text can be written on the banner. Single words in one line of the banner should be separated by spaces. You are allowed to insert more than one space at once. Note that you are not allowed to break the words, that is, each word in the text must occupy exactly one line in the banner. Besides, you cannot change the word order, that is, if you read the banner text consecutively, from top to bottom and from left to right, you should get some consecutive part of the advertisement text.

More formally, the statement can be written like that. Let's say that all words are indexed from 1 to n in the order in which they occur in the advertisement text. Then you have to choose all words, starting from some i-th one and ending with some j-th one (1 ≤ i ≤ j ≤ n), so that all of them could be written on the banner. There must be as many words as possible. See the samples for clarifications.

Input

The first input line contains three integers n, r, c (1 ≤ n, r, c ≤ 106; r × c ≤ 106). The next line contains a text, consisting of n words. The words consist only of lowercase English letters and are not empty. The words in the lines are separated by single spaces. The total number of characters in all words doesn't exceed 5·106.

Output

Print at most r lines, in each line print at most c characters — the optimal advertisement banner. If there are multiple advertisement banners, print any of them. 

Note that some lines of the banner can be empty. You are allowed not to print such lines.

Examples

Input

9 4 12
this is a sample text for croc final round


Output

this is a
sample text
for croc
final round


Input

9 1 9
this is a sample text for croc final round


Output

this is a


Input

6 2 3
croc a a a croc a


Output

a a
a


Input

2 2 5
first second


Output

first

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Locale;
import java.util.StringTokenizer;

public class B {

	private void solve() throws IOException {
		int n = nextInt();
		int r = nextInt();
		int c = nextInt();
		
		String s = reader.readLine();
		String[] all = new String[n];
		StringTokenizer st = new StringTokenizer(s);
		for (int i = 0; i < n; i++) {
			all[i] = st.nextToken();
		}
		
		int[] start = new int[n];
		int[] finish = new int[n];
		int len = 0;
		for (int i = 0; i < n; i++) {
			start[i] = len;
			len += all[i].length();
			finish[i] = len - 1;
			len++;
		}
		
		char[] a = s.toCharArray();
		int[] wordIndex = new int[a.length];
		
		for (int i = 1; i < a.length; i++) {
			if (a[i] == ' ') {
				wordIndex[i] = wordIndex[i - 1] + 1;
			} else {
				wordIndex[i] = wordIndex[i - 1];
			}
		}
		for (int i = 0; i < a.length; i++) {
			if (a[i] == ' ') {
				wordIndex[i]--;
			}
		}
		
		int[] lines = new int[n];
		int[] words = new int[n];
		int[] onLine = new int[n];
		int[][] prevW = new int[20][n];
		
		for (int i = 0; i < n; i++) {
			int prev = finish[i] - c;
			int wordsOnLine = 0;

			if (prev < 0) {
				wordsOnLine = i + 1;
				lines[i] = 1;
				words[i] = wordsOnLine;
				onLine[i] = wordsOnLine;
				continue;
			} else {
				wordsOnLine = i - wordIndex[prev];
			}
			
			if (wordsOnLine == 0) {
				continue;
			}
			
			
			if (r == 1) {
				lines[i] = 1;
				words[i] = wordsOnLine;
				onLine[i] = wordsOnLine;
				continue;
			}
			
			int prevWord = wordIndex[prev];
			if (lines[prevWord] == r) {
				lines[i] = r;
				
				int begin = prevWord - words[prevWord] + 1;
				int d = r - 1;
				int p = prevWord;
				int t = 20;
				while (d != 0) {
					if ((1 << t) > d) {
						t--;
					} else {
						d -= 1 << t;
						p = prevW[t][p];
					}
				}
				
				int w = p - begin + 1;
				words[i] = words[prevWord] - w + wordsOnLine;
			} else {
				lines[i] = lines[prevWord] + 1;
				words[i] = words[prevWord] + wordsOnLine;
			}
			
			prevW[0][i] = prevWord;
			for (int j = 1; j < 20; j++) {
				prevW[j][i] = prevW[j - 1][prevW[j - 1][i]];
			}
			onLine[i] = wordsOnLine;
		}
		
		
		
		int ans = 0;
		for (int i = 1; i < n; i++) {
			if (words[i] > words[ans]) {
				ans = i;
			}
		}
		
		int p = ans;
		ArrayList<String> res = new ArrayList<String>();
		for (int i = 0; i < lines[ans]; i++) {
			StringBuilder sb = new StringBuilder();
			for (int j = p - onLine[p] + 1; j <= p; j++) {
				sb.append(all[j]);
				if (j < p) {
					sb.append(' ');
				}
			}
			
			res.add(sb.toString());
			p = prevW[0][p];
		}
		
		Collections.reverse(res);
		for (String t: res) {
			println(t);
		}
	}

	private String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	private double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private void print(Object o) {
		writer.print(o);
	}

	private void println(Object o) {
		writer.println(o);
	}

	private void printf(String format, Object... o) {
		writer.printf(format, o);
	}

	public static void main(String[] args) {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		new B().run();
		System.err.printf("%.3f\n", 1e-3 * (System.currentTimeMillis() - time));
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	private void run() {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(13);
		}
	}
}