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>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
typedef long long ll;
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
char ans[2005][10005];
char s[2005][10005];
int len[2005],start[2005][10005];
int n,k;
bitset<10005>can[2005];
char Max='z'+1;
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++){
		scanf("%s",s[i]+1);
		len[i]=strlen(s[i]+1);
	}
	can[n].reset();can[n].set(0);
	for(int i=n-1;i>0;i--){
		can[i]=can[i+1]|(can[i+1]<<len[i+1]);
	}	
	for(int i=1;i<=k;i++)ans[0][i]=Max;
	start[0][1]=1;start[0][k+1]=1;
	for(int i=1;i<=n;i++){
		memcpy(ans[i],ans[i-1],sizeof ans[i]);
		memcpy(start[i],start[i-1],sizeof start[i-1]);
		for(int j=1;j<=k;j++){
			if(j+len[i]-1>k||!can[i][k-(j+len[i]-1)]||(!start[i-1][j]&&ans[i][j]!=Max))continue;
			if(j>1&&ans[i][j-1]==Max)break;
			int lcp=0;
			bool ok=true;
			while(1+lcp<=len[i]&&j+lcp<=k&&ans[i][j+lcp]==s[i][1+lcp])lcp++;
			int nxt=j+lcp;
			if(lcp==len[i]){
				start[i][nxt]=1;
				continue;
			}
			if(ans[i][nxt]>s[i][lcp+1]){
				for(int _=j;_<j+len[i];_++){
					if(_>nxt)start[i][_]=0;
					ans[i][_]=s[i][_-j+1];
				}
				for(int _=j+len[i];_<=k;_++)ans[i][_]=Max,start[i][j]=0;
				start[i][j]=1;
				break;
			}
		}
	}
	string _ans=""; 
	for(int i=1;i<=k;i++)_ans+=ans[n][i];
	can[n].reset();can[n].set(0);
	for(int i=n-1;i>0;i--){
		can[i]=can[i+1]|(can[i+1]<<len[i+1]);
	}	
	for(int i=1;i<=k;i++)ans[0][i]=Max;
	start[0][1]=1;start[0][k+1]=1;
	for(int i=1;i<=n;i++){
		memcpy(ans[i],ans[i-1],sizeof ans[i]);
		memcpy(start[i],start[i-1],sizeof start[i-1]);
		for(int j=1;j<=k;j++){
			if(j+len[i]-1>k||!can[i][k-(j+len[i]-1)]||(!start[i-1][j]&&ans[i][j]!=Max))continue;
			if(j>1&&ans[i][j-1]==Max)break;
			int lcp=0;
			bool ok=true;
			while(1+lcp<=len[i]&&j+lcp<=k&&ans[i][j+lcp]==s[i][1+lcp])lcp++;
			int nxt=j+lcp;
			if(lcp==len[i]){
				start[i][nxt]=1;
				continue;
			}
			if(ans[i][nxt]>s[i][lcp+1]){
				for(int _=j;_<j+len[i];_++){
					start[i][_]=0;
					ans[i][_]=s[i][_-j+1];
				}
				for(int _=j+len[i];_<=k;_++)ans[i][_]=Max,start[i][j]=0;
				start[i][j]=1;
				break;
			}
		}
	}
	string __ans=""; 
	for(int i=1;i<=k;i++)__ans+=ans[n][i];
	cout<<min(_ans,__ans)<<endl;
	return 0;
}