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.math.BigInteger;
import java.text.DecimalFormat;
import java.util.*;
import java.io.*;



public class Main {
    private static int n,R,C;
    private static String [] line;
    private static char [] [] out;
    private static int S,E;


    private static void solve(){
        Deque<Integer> dq = new ArrayDeque<>();
        int sum = 0,ctr = 0;
        int [] cnt = new int[n+1];
        boolean [] inDq = new boolean[n];
        for (int i = 0,j = 0;i < n;i++) {
            if (j < i) {
                j = i;
                sum = ctr = 0;
                dq.clear();
            }
            while (j < n && sum + line[j].length() <= C) {
                sum += line[j].length();
                ctr ++;
                dq.addLast(j);
                inDq[j] = true;
                if (sum < C) {
                    sum++;
                    dq.addLast(-1);
                }
                j++;
            }
//            System.err.println(i + ": " + dq);
            if (inDq[i]) cnt[i] = ctr;
            while (!dq.isEmpty() && (dq.getFirst() == -1 || dq.getFirst() == i)) {
                int k = dq.pollFirst();
                if (k == -1) sum--;
                else {
                    sum -= line[k].length();
                    ctr--;
                }
            }
            if (!dq.isEmpty() && dq.getLast() != -1) {
                sum++;
                dq.add(-1);
            }
        }

//        System.err.println(Arrays.toString(cnt));
        int mx = 0;
        S = E = 0;

        int [] depth = new int[n+1];
        for (int i = n-1;i >= 0;i--)
            if (cnt[i] != 0)
                depth[i] = depth[i + cnt[i]] + 1;
        int MAXLG = 18;
        int [] [] P = new int[n+1][MAXLG];
        for (int u = n;u >= 0;u--){
            int p = u + cnt[u];
            if (u == p) {
                for (int i = 0;i < MAXLG;i++)
                    P[u][i] = u;
            }
            else {
                P[u][0] = p;
                for (int i = 0;i+1 < MAXLG;i++)
                    P[u][i+1] = P[P[u][i]][i];
            }
//            System.err.printf("P[%d] = %d\n",u,p);
        }
        for (int u = 0;u < n;u++) {
            int k = depth[u];
            if (k > R )
                k = R ;
//            System.err.print(u + "^" + k + " = ");
            int v = u,i = 0;
            while (k > 0) {
                int r = k & -k;
                while (r != (1 << i)) i++;
                v = P[v][i];
                k ^= r;
            }
//            System.err.println(v);
            if (v - u > mx) {
                mx = v - u;
                S = u;
                E = v;
            }
        }
    }

    private static void build() throws Exception{
        out = new char[R][C];
        for (int r = 0;r < R;r++)
            for (int c = 0;c < C;c++)
                out[r][c] = ' ';
        for (int i = S,r = 0;r < R;r++){
            for (int c = 0;i < E && c + line[i].length() <= C;i++){
                for (char ch : line[i].toCharArray())
                    out[r][c++] = ch;
                if (c != C) out[r][c++] = ' ';
            }
        }
    }
    public static void main(String[] args) throws Exception {
        IO io ;
        try {
            io = new IO("in.in", null);
        } catch (IOException e) {
            io = new IO(null, null);
        }

        n = io.getNextInt();
        R = io.getNextInt();
        C = io.getNextInt();
        line = new String[n];
        for (int i = 0;i < n;i++)
            line[i] = io.getNext();

        solve();
        build();
        for (int r = 0;r < R;r++)
            io.println(new String(out[r]));
        io.close();
    }
    private static final int onebillion7 = 1000000007;
}



class IO{
    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter writer;
    private String inputFile,outputFile;

    public boolean hasMore() throws IOException{
        if(st != null && st.hasMoreTokens()) return true;
        if(br != null && br.ready()) return true;
        return false;
    }

    public String getNext() throws FileNotFoundException, IOException{
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public String getNextLine() throws FileNotFoundException, IOException{
        return br.readLine().trim();
    }

    public int getNextInt() throws FileNotFoundException, IOException{
        return Integer.parseInt(getNext());
    }
    public long getNextLong() throws FileNotFoundException, IOException{
        return Long.parseLong(getNext());
    }

    public void print(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f" ,x);
    }
    public void println(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f\n" ,x);
    }
    public void print(Object o) throws  IOException{
        writer.print(o.toString());
    }

    public void println(Object o) throws  IOException{
        writer.println(o.toString());
    }
    public IO(String x,String y) throws FileNotFoundException, IOException{
        inputFile = x;
        outputFile = y;
        if(x != null) br = new BufferedReader(new FileReader(inputFile));
        else br = new BufferedReader(new InputStreamReader(System.in));
        if(y != null) writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        else writer = new PrintWriter(new OutputStreamWriter(System.out));
    }

    protected void close() throws IOException{
        br.close();
        writer.close();
    }
    public void outputArr(Object [] A) throws IOException{
        int L = A.length;
        for (int i = 0;i < L;i++) {
            if(i > 0) writer.print(" ");
            writer.print(A[i]);
        }
        writer.print("\n");
    }
}