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<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 2e+3+3;
const int K = 1e+4+3;
const int L = 1e+6+5;

bool f[N][K];
int n,k;
char s[L],ans[K];
int st[N],len[N],m;
bool bz[K],qbz[K];
int nxt[L];
int tr[K];

int better(int x,int y,int i){
	int wx=x+1+tr[x+1],wy=y+1+tr[y+1];
	if (wx!=wy)return wx<wy?x:y;
	if (x<y)swap(x,y);
	int l=nxt[x-y+1];
	if (l==len[i]-(x-y))return x;
	char u=s[st[i]+l],v=s[st[i]+x-y+l];
	return u<v?x:y;
}

int main(){
	n=get();k=get();
	m=0;
	fo(i,1,n){
		scanf("%s",s+m+1);
		len[i]=strlen(s+m+1);
		st[i]=m+1;
		m+=len[i];
	}
	f[n+1][0]=1;
	fd(i,n,1){
		fo(j,0,k){
			f[i][j]=f[i+1][j];
			if (j>=len[i])f[i][j]|=f[i+1][j-len[i]];
		}
	}
	fo(i,1,k)ans[i]='z'+1;
	bz[0]=1;
	fo(i,1,n){
		int w=0,p=0;
		fo(j,2,len[i]){
			nxt[j]=0;
			if (w+p-1>=j)nxt[j]=min(nxt[j-w+1],w+p-j);
			while(j+nxt[j]<=len[i]&&s[st[i]+j+nxt[j]-1]==s[st[i]+nxt[j]])nxt[j]++;
			if (j+nxt[j]>w+p)w=j,p=nxt[j];
		}
		w=0,p=0;
		fo(j,1,k){
			tr[j]=0;
			if (w+p-1>=j)tr[j]=min(nxt[j-w+1],w+p-j);
			while(j+tr[j]<=k&&tr[j]<len[i]&&ans[j+tr[j]]==s[st[i]+tr[j]])tr[j]++;
			if (j+tr[j]>w+p)w=j,p=tr[j];
		}
		fo(j,0,k){qbz[j]=bz[j];bz[j]=0;}
		int key=-1;
		fo(j,0,k)
		if (qbz[j]&&j+len[i]<=k&&f[i+1][k-j-len[i]]){
			if (tr[j+1]<len[i]&&j+tr[j+1]+1<=k&&s[st[i]+tr[j+1]]<ans[j+tr[j+1]+1]){
				if (key==-1)key=j;
				else key=better(key,j,i);
			}
		}
		if (key!=-1){
			fo(j,tr[key+1]+1,len[i])ans[key+j]=s[st[i]+j-1];
			fo(j,key+len[i]+1,k)ans[j]='z'+1;
			fo(j,key+1+tr[key+1],k)qbz[j]=0;
		}
		w=0,p=0;
		fo(j,1,k){
			tr[j]=0;
			if (w+p-1>=j)tr[j]=min(nxt[j-w+1],w+p-j);
			while(j+tr[j]<=k&&tr[j]<len[i]&&ans[j+tr[j]]==s[st[i]+tr[j]])tr[j]++;
			if (j+tr[j]>w+p)w=j,p=tr[j];
		}
		fo(j,0,k)
		if (qbz[j]){
			if (f[i+1][k-j])bz[j]=1;
			if (tr[j+1]==len[i]&&f[i+1][k-j-len[i]])bz[j+len[i]]=1;
		}
	}
	fo(i,1,k)putchar(ans[i]);
	putchar('\n');
	return 0;
}