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;

string str[2000];

const int MAXN=2e4+5;
int z[MAXN];
string s,ss;
void Zvalue(int len){
   z[0]=len;
   int l=0,r=0,x;
   for(int i=1;i<len;i++){
      if(r<i||z[i-l]>=r-i+1){
         r<i?x=i:x=r+1;
         while(x<len&&ss[x]==ss[x-i])  x++;
         z[i]=x-i;if(i<x){l=i;r=x-1;};
      }
      else
         z[i]=z[i-l];
   }
   z[len]=0;
}

bool dp[2001][10001];
bool can[10001];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++)
		cin>>str[i];
	dp[n][0]=true;
	for(int i=n-1;i>=0;i--)
		for(int j=0;j<=k;j++)
			dp[i][j]=(dp[i+1][j]|(j<str[i].size()?false:dp[i+1][j-str[i].size()]));
	int now=0;
	can[0]=true;
	for(int i=0;i<n;i++){
		ss=str[i]+'@'+s;
		int len=str[i].size();
		Zvalue(ss.size());
		int mn=-1;
		for(int j=0;j<=now;j++){
			if(!can[j]||(str[i].size()+j>k)||!dp[i+1][k-str[i].size()-j])	continue;
			if(mn==-1){
				if(j==now)	mn=j;
			/*	else if(z[len+j+1]==len)
					mn=j;
				else if(z[len+j+1]<len&&ss[z[len+j+1]]<ss[len+j+1+z[len+j+1]])	mn=j;*/
				else if(z[len+j+1]<len&&(len+j+1+z[len+j+1]==ss.size()||ss[z[len+j+1]]<ss[len+j+1+z[len+j+1]]))	mn=j;
			}
			else{
				if(z[len+mn+1]>=j-mn){
					if(z[j-mn]==len-(j-mn))
						mn=j;
					else if(str[i][z[j-mn]]<str[i][j-mn+z[j-mn]])
						mn=j;
				}
				else if(s[z[len+mn+1]+mn]<str[i][z[len+mn+1]])
					mn=j;
			}
		}
		if(mn!=-1){
			int tmp=mn+z[len+mn+1];
			ss=str[i]+'@'+s.substr(0,mn)+str[i];
			Zvalue(ss.size());
			for(int j=tmp+1;j<=10000;j++)
				can[j]=false;
			for(int j=k;j>=0;j--)
				if((can[j]&&dp[i+1][k-j])||(j-len>=0&&can[j-len]&&dp[i+1][k-j]&&z[j+1]==len))
						can[j]=true;
				else
					can[j]=false;

			can[mn+str[i].size()]=true;
			s=s.substr(0,mn);
			s+=str[i];
			now=mn+str[i].size();
		}
	}
	cout<<s<<endl;
}