import java.io.*;
import java.util.*;

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

public class ContextAdvertising {
	public static void main(String[] args) throws IOException {
	  Scanner sc = new Scanner(System.in);
		
	  //READ----------------------------------------------------
    int n = sc.nextInt(), r = sc.nextInt(), c = sc.nextInt(); sc.nextLine();
    String[] line = sc.nextLine().split(" ");
    int[] t = new int[line.length];
    String[] ad = new String[line.length];
    
  //SOLVE----------------------------------------------------
    int max = 0;
    int indMax = 0;

    for (int i = 0; i < t.length; i++)
    {
      int row = r;
      ad[i] = "";
      int len = 0;
      for (int j = i; j < t.length; j++)
      {
        if(len == 0 && line[j].length() <= c){
          ad[i] += line[j];
          len = line[j].length();
        }
        else if(len +1+ line[j].length() <= c){
          ad[i] += " "+line[j];
          len += 1 + line[j].length();
        }
        else if(line[j].length() <= c){
          len = 0;
          row--;
          if(row==0)
            break;
          else{
            ad[i] += "\n"+line[j];
            len = line[j].length();
          }
        }
        else
          break;
      }
      
      //System.out.println("---"+ad[i] +" "+ad[i].length());
      
      if(ad[i].length()>max){
        indMax = i;
        max = ad[i].length();
        //System.out.println(i +"=Max" );
      }
    }
		
	
		
    //CLOSE----------------------------------------------------
    System.out.print(ad[indMax].trim());
    sc.close();
	}
}