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;

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)

int read(){
	int i;
	scanf("%d",&i);
	return i;
}

char strBuf[1<<20],curBuf[20001];
int zBuf[1<<20],len[2000],lcpBuf[20001];
bool dp[2001][10001],can[10001];

void Zalgo(char* str,int s,int* lcp){
	fill(lcp,lcp+s+1,0);
	int p=0;
	FOR(i,1,s){
		if(i+lcp[i-p]<p+lcp[p])
			lcp[i]=lcp[i-p];
		else{
			lcp[i]=max(0,p+lcp[p]-i);
			while(i+lcp[i]<s&&str[lcp[i]]==str[i+lcp[i]])
				lcp[i]++;
			p=i;
		}
	}
	lcp[0]=s;
}

int main(){
	int n=read(),k=read(),off=0;
	REP(i,n){
		scanf("%s",strBuf+off);
		len[i]=strlen(strBuf+off);
		Zalgo(strBuf+off,len[i],zBuf+off);
		off+=len[i]+1;
	}
	dp[n][0]=true;
	for(int i=n-1;i>=0;i--)
		REP(j,k+1)
			dp[i][j]=dp[i+1][j]|(j<len[i]?false:dp[i+1][j-len[i]]);
	can[0]=true;
	int s=0,*lcp=lcpBuf+k,*z=zBuf;
	char *cur=curBuf+k,*str=strBuf;
	REP(i,n){
		REP(j,len[i])
			cur[j-len[i]]=str[j];
		Zalgo(cur-len[i],s+len[i],lcp-len[i]);
		int mn=-1;
		REP(j,s+1){
			if(!can[j]||j+len[i]>k||!dp[i+1][k-j-len[i]])
				continue;
			if(mn==-1){
				if(lcp[j]<len[i]){
					if(j+lcp[j]==s)
						mn=j;
					else if(cur[j+lcp[j]]>str[lcp[j]])
						mn=j;
				}
			}else{
				if(j-mn<len[i]&&lcp[mn]>=j-mn){
					int p=j-mn;
					if(p+z[p]==len[i])
						mn=j;
					else if(str[p+z[p]]>str[z[p]])
						mn=j;
				}
			}
		}
		if(mn>=0){
			bool w=true;
			REP(j,len[i]){
				w&=(cur[j+mn]==str[j]);
				can[j+mn+1]&=w;
				cur[j+mn]=str[j];
			}
			FOR(j,mn+len[i]+1,s+1)
				can[j]=false;
			s=mn+len[i];
			Zalgo(cur-len[i],s+len[i],lcp-len[i]);
		}
		for(int j=s;j>=0;j--)
			if(can[j]&&lcp[j]>=len[i])
				can[j+len[i]]=true;
		z+=len[i]+1;
		str+=len[i]+1;
	}
	printf("%s\n",cur);
}