#include <bits/stdc++.h>
using namespace std;
template <typename T, typename TT>
ostream &operator<<(ostream &s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream &operator<<(ostream &s, vector<T> t) {
  s << "{";
  for (int i = 0; i < t.size(); i++)
    s << t[i] << (i == t.size() - 1 ? "" : ",");
  return s << "}" << endl;
}
vector<string> S;
int d[1000002];
char s[7000005];
int ne[1000002][22];
int main() {
  ios_base::sync_with_stdio(0);
  int n, r, c;
  scanf("%d%d%d", &(n), &(r), &(c));
  ;
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    d[i] = strlen(s);
    S.push_back(string(s));
  }
  d[n] = r + c + 5;
  int dokad = 0;
  int sum = d[0] + 1;
  for (int i = 0; i < n; i++) {
    if (d[i] > c) {
      ne[i][0] = i;
      sum = d[i] + 1;
      dokad = i;
    } else if (d[i] == c) {
      ne[i][0] = i + 1;
      sum = d[i] + 1 + d[i + 1] + 1;
      dokad = i + 1;
    } else {
      if (i) sum -= d[i - 1] + 1;
      while (sum <= c + 1) {
        sum += d[++dokad] + 1;
      }
      ne[i][0] = dokad;
    }
  }
  ne[0][n] = n;
  for (int j = 1; (1 << j) <= r; j++) {
    for (int i = 0; i < n + 1; i++) ne[i][j] = ne[ne[i][j - 1]][j - 1];
  }
  int best = 0;
  int ind = 0;
  for (int i = 0; i < n; i++) {
    int x = r;
    int a = i;
    for (int j = 21; j >= 0; j--) {
      if (x >= (1 << j)) {
        a = ne[a][j];
        x -= (1 << j);
      }
    }
    if (a - i > best) {
      best = a - i;
      ind = i;
    }
  }
  int wiersz = 0;
  int liter = 0;
  int nr = 0;
  while (wiersz < r) {
    if (liter + d[ind] + (!!nr) <= c) {
      liter += d[ind] + (!!nr);
      if (nr) printf(" ");
      nr++;
      printf("%s", S[ind].c_str());
      ind++;
    } else {
      nr = 0;
      wiersz++;
      liter = 0;
      if (wiersz < r) puts("");
    }
  }
  return 0;
}
