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=2e3+7;
// z[i] = len of lcp of s, s[i..]; lcp(longest common prefix)
int z[20007];
void z_fn(const string& s) {
    int n = s.size();
    for(int i=0;i<n;i++) z[i]=0;
    for (int i = 1, l = 0, r = 0; i < n; i++) 
    {
        if (i <= r)
            z[i] = min(r-i+1, z[i-l]);
        while (i+z[i] < n && s[z[i]] == s[i+z[i]]) 
            z[i]++;
        if (i+z[i]-1 > r) 
        {
            l = i;
            r = i+z[i]-1;
        }
    }
}
bool cg[maxn][10007];
bool l[10007];
int n,k;
string s[maxn];
void db()
{
    l[0]=1;
    for(int i=n;i>=1;i--)
    {
        for(int j=k;j>=0;j--)
        {
            cg[i][j]=l[j];
            if(j>=s[i].length())
                l[j]|=l[j-s[i].length()];
        }
    }
}
int dp[10007];
void solve()
{
    dp[0]=1;
    string pre;
    for(int i=0;i<k;i++) pre+='z'+1;
    for(int i=1;i<=n;i++)
    {
        string cur=s[i]+'$'+pre;
        int len=s[i].length();
        z_fn(cur);
        //cout<<cur<<endl;
        //for(int i=0;i<cur.length();i++) cout<<i<<":"<<z[i]<<endl;
        int pos=-1,curans=k;
        //cout<<i<<"!"<<s[i].length()<<endl;
        for(int j=k-s[i].length();j>=0;j--)
        {
            if(!dp[j]||!cg[i][k-len-j]) continue;
            int lcp=z[len+1+j];
            //cout<<i<<","<<j<<":"<<lcp<<endl;
            if(lcp>=len) continue;
            if(s[i][lcp]<pre[j+lcp]&&j+lcp<curans)
            {
                pos=j;
                curans=j+lcp;
            }
        }
        if(pos==-1) continue;
        for(int j=0;j<len;j++)
            pre[j+pos]=s[i][j];
        for(int j=pos+len;j<k;j++)
            pre[j]='z'+1;
        for (int j=pos+z[len+1+pos]+1;j<k;j++)
            dp[j]=false;
        dp[pos+len]=true;
        //cout<<i<<":"<<pre<<endl;
    }
    cout<<pre<<endl;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>k;
    for(int i=1;i<=n;i++) cin>>s[i];
    db();
    solve();
}