#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double eps = (1e-10);
int isGreater(long double x, long double y) {
  if (abs(x - y) < eps) return 0;
  if (x > y) return 1;
  return -1;
}
const int MAX_N = 1e6 + 5;
string s[MAX_N];
int nxt[MAX_N];
int n, r, c;
int sum[MAX_N];
bool valid(int left, int right) {
  if (left > right) return true;
  int sumC = sum[right];
  if (left) sumC -= sum[left - 1];
  sumC += (right - left);
  return sumC <= c;
}
int bs(int i) {
  int st = i, en = n;
  while (st < en) {
    int mid = st + (en - st + 1) / 2;
    if (valid(i, mid - 1))
      st = mid;
    else
      en = mid - 1;
  }
  return st;
}
const int K = 21;
int up[MAX_N][K], sumUp[MAX_N][K];
bool visit[MAX_N];
void calc(int i) {
  if (visit[i]) return;
  visit[i] = true;
  if (nxt[i] == i) {
    for (int j = 0; j < K; ++j) up[i][j] = i, sumUp[i][j] = 0;
  } else {
    up[i][0] = nxt[i], sumUp[i][0] = nxt[i] - i;
    for (int j = 1; j < K; ++j) {
      int to = nxt[j - 1];
      calc(to);
      up[i][j] = up[to][j - 1];
      sumUp[i][j] = sumUp[i][j - 1] + sumUp[to][j - 1];
    }
  }
}
int getBest(int i) {
  int temp = r, ret = 0;
  for (int j = K - 1; j >= 0; --j) {
    if ((1 << j) <= temp) {
      temp -= (1 << j);
      ret += sumUp[i][j];
      i = up[i][j];
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> r >> c;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    sum[i] = (int)(s[i]).size();
    if (i) sum[i] += sum[i - 1];
  }
  for (int i = 0; i < n; ++i) nxt[i] = bs(i);
  nxt[n] = n;
  for (int i = 0; i < n; ++i) calc(i);
  int ans = 0, ansIdx = 0;
  for (int i = 0; i < n; ++i) {
    if (getBest(i) > ans) {
      ans = getBest(i);
      ansIdx = i;
    }
  }
  vector<pair<int, int> > out;
  for (int j = 0; j < r; ++j) {
    out.push_back({ansIdx, nxt[ansIdx]});
    if (ansIdx == nxt[ansIdx]) break;
    ansIdx = nxt[ansIdx];
  }
  for (int i = 0; i < (int)(out).size(); ++i) {
    for (int j = out[i].first; j < out[i].second; ++j)
      cout << s[j] << " \n"[j + 1 == out[i].second];
  }
  return 0;
}
