Problem: Iroha has a sequence of N strings s_1, s_2, ..., s_N.

She will choose some (possibly all) strings from the sequence, then concatenate those strings retaining the relative order, to produce a long string.

Among all strings of length K that she can produce in this way, find the lexicographically smallest one.

Constraints

* 1 ≦ N ≦ 2000
* 1 ≦ K ≦ 10^4
* For each i, 1 ≦ |s_i| ≦ K.
* |s_1| + |s_2| + ... + |s_N| ≦ 10^6
* For each i, s_i consists of lowercase letters.
* There exists at least one string of length K that Iroha can produce.

Input

The input is given from Standard Input in the following format:


N K
s_1
s_2
:
s_N


Output

Print the lexicographically smallest string of length K that Iroha can produce.

Examples

Input

3 7
at
coder
codar


Output

atcodar


Input

3 7
coder
codar
at


Output

codarat


Input

4 13
kyuri
namida
zzzzzzz
aaaaaa


Output

namidazzzzzzz

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;

const int maxN = 2005, maxK = 10003;
pair<int, int> a[2][1000005];
string str[maxN];
char ans[maxK];
bitset<maxK> can[maxN];

int main() {
	ios::sync_with_stdio(false);cin.tie(0);
	int N, K; cin >> N >> K;
	for(int i = 1; i <= N; ++i) cin >> str[i];
	can[N + 1][0] = 1;
	for(int i = N; i >= 1; --i) can[i] = can[i + 1] | (can[i + 1] << str[i].length());
	int cnt[2] = {0, 0};
	for(int i = 1; i <= N; ++i) if((str[i].length() <= K) && can[i + 1][K - str[i].length()]) 
		a[0][++cnt[0]] = make_pair(i, 0);
	int nw = 0;
	//cout << cnt[0] << "********"<<endl; 
	for(int i = 1; i <= K; ++i) {
		char minn = 'z';
		cnt[nw] = min(cnt[nw], maxK);
		for(int j = 1; j <= cnt[nw]; ++j) {
			int t1 = a[nw][j].first, t2 = a[nw][j].second;
			minn = min(minn, str[t1][t2]);
		//	cout << t1 <<' ' << t2 << endl;
		}
		ans[i] = minn;
		//cout << (minn - 'a') << endl;
		int idx = 100000000;
		for(int j = 1; j <= cnt[nw]; ++j) {
			int t1 = a[nw][j].first, t2 = a[nw][j].second;
			if(minn != str[t1][t2]) continue;
			if(t2 == str[t1].length() - 1) idx = min(idx, t1 + 1);
			else {
				a[nw ^ 1][++cnt[nw ^ 1]] = make_pair(t1, t2 + 1);
			}
		}
		for(int j = idx; j <= N; ++j) {
			//cout <<minn<<endl; 
			if(str[j].length() + i <= K && can[j + 1][K - str[j].length() - i])
				a[nw ^ 1][++cnt[nw ^ 1]] = make_pair(j, 0);
		}
		cnt[nw] = 0;nw ^= 1; 
	}
	cout << ans + 1 << endl;
	return 0;
 }