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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
namespace fastio {
char in[100000];
int itr = 0, llen = 0;
char get() {
  if (itr == llen) llen = fread(in, 1, 100000, stdin), itr = 0;
  if (llen == 0) return EOF;
  return in[itr++];
}
char out[100000];
int itr2 = 0;
void put(char c) {
  out[itr2++] = c;
  if (itr2 == 100000) {
    fwrite(out, 1, 100000, stdout);
    itr2 = 0;
  }
}
int clear() {
  fwrite(out, 1, itr2, stdout);
  itr2 = 0;
  return 0;
}
int getint() {
  int ret = 0;
  char ch = get();
  while (ch < '0' || ch > '9') {
    ch = get();
    if (ch == '-') return -getint();
  }
  while ('0' <= ch && ch <= '9') {
    ret = ret * 10 - 48 + ch;
    ch = get();
  }
  return ret;
}
string getstr() {
  string ret = "";
  char ch = get();
  while (ch == ' ' || ch == '\n') ch = get();
  while (ch != ' ' && ch != '\n') ret.push_back(ch), ch = get();
  return ret;
}
void putstr(string s) {
  for (int i = 0; i < s.size(); i++) put(s[i]);
}
void putint(int x) {
  if (x < 0) {
    put('-');
    putint(-x);
    return;
  }
  if (x == 0) {
    put('0');
    return;
  }
  char c[40];
  int pos = 0;
  while (x) {
    c[pos++] = '0' + x % 10;
    x /= 10;
  }
  for (int i = pos - 1; i >= 0; i--) put(c[i]);
  put(' ');
}
void putln(int x) {
  if (x < 0) {
    put('-');
    putln(-x);
    return;
  }
  if (x == 0) {
    put('0');
    put('\n');
    return;
  }
  char c[40];
  int pos = 0;
  while (x) {
    c[pos++] = '0' + x % 10;
    x /= 10;
  }
  for (int i = pos - 1; i >= 0; i--) put(c[i]);
  put('\n');
}
}  // namespace fastio
using namespace fastio;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
inline string getstr(string &s, int l, int r) {
  string ret = "";
  for (int i = l; i <= r; i++) ret.push_back(s[i]);
  return ret;
}
int modpow(int x, int y, int md = mod) {
  if (y == 0) return 1;
  int ret = modpow(x, y >> 1, md);
  ret = (long long)ret * ret % md;
  if (y & 1) ret = (long long)ret * x % md;
  return ret;
}
int n, r, c;
string s[1000005];
int len[1000005], nxt[1000005];
int pref[1000005];
vector<int> g[1000005];
void add_edge(int x, int y) { g[y].push_back(x); }
bool vis[1000005];
vector<int> stk;
int ans = -1, st;
void dfs(int x) {
  vis[x] = 1;
  stk.push_back(x);
  int sub = min((int)stk.size(), r + 1);
  int pos = stk.size() - sub;
  if (stk[pos] - x > ans) {
    ans = stk[pos] - x;
    st = x;
  }
  for (int i = 0; i < g[x].size(); i++) {
    dfs(g[x][i]);
  }
  stk.pop_back();
}
int main() {
  n = getint();
  r = getint();
  c = getint() + 1;
  for (int i = 1; i <= n; i++) s[i] = getstr();
  for (int i = 1; i <= n; i++) len[i] = s[i].size() + 1;
  for (int i = 1; i <= n; i++) pref[i] = pref[i - 1] + len[i];
  for (int i = 1; i <= n; i++) {
    if (len[i] > c) continue;
    int L = i - 1, R = n + 1;
    while (R - L > 1) {
      int mid = L + R >> 1;
      if (pref[mid] - pref[i - 1] <= c)
        L = mid;
      else
        R = mid;
    }
    if (0) cout << R << "--->" << i << " value=" << R - i << endl;
    nxt[i] = R;
    add_edge(i, R);
  }
  for (int i = n + 1; i >= 1; i--)
    if (!vis[i]) dfs(i);
  if (0) cout << st << endl;
  for (int line = 1; line <= r; line++) {
    if (len[st] > c) break;
    for (int i = st; i < nxt[st]; i++) {
      if (i != st) put(' ');
      putstr(s[i]);
    }
    put('\n');
    st = nxt[st];
  }
  clear();
  return 0;
}