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 = 2018,MaxK = 10003;
typedef pair<int,int> PII;
#define mp make_pair
int n,k;
string str[MaxN];
bitset<MaxK> can[MaxN];  //can[i][j] => string with length j can be made up by str[i~n]
int cur,cnt0,cnt1;
PII pos[2][1000000];  //candidate solution list
char ans[MaxK];
int main() {
    ios::sync_with_stdio(false);cin.tie(0);
    cin >> n >> k;
    for (int i=1;i<=n;++i) cin >> str[i];
    can[n+1][0]=1;
    for (int i=n;i>=1;--i) can[i]=can[i+1]|(can[i+1]<<(str[i].length()));
    for (int i=1;i<=n;++i) if (can[i+1][k-str[i].length()]) pos[cur][++cnt0]=mp(i,0);
    for (int I=1;I<=k;++I) {
        char ch='z';
        cnt0=min(cnt0,MaxK);
        for (int i=1;i<=cnt0;++i) {
            PII& t=pos[cur][i];
            ch=min(ch,str[t.first][t.second]);
        }
        ans[I]=ch;
        cnt1=0;
        int mn=0x7fffffff;  //minimum new string
        for (int i=1;i<=cnt0;++i) {
            PII& t=pos[cur][i];
            if (str[t.first][t.second]!=ch) continue;
            if (t.second==str[t.first].length()-1)
                mn=min(mn,t.first+1);
            else
                pos[cur^1][++cnt1]=mp(t.first,t.second+1);
        }
        for (int i=mn;i<=n;++i)
            if (I+str[i].length()<=k && can[i+1][k-I-str[i].length()])
                pos[cur^1][++cnt1]=mp(i,0);
        cur^=1;cnt0=cnt1;
    }
    cout << ans+1 << endl;
    return 0;
}