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 = 2005;
const int MAXK = 10005;

int n, k, br;
string s[MAXN], curr;
int z[MAXK*2];
bool dp[MAXN][MAXK], ok[MAXK];

void precompute () {
    dp[n][0] = 1;
    for (int i = n-1; i >= 0; i--) {
        int len = s[i].size();
        for (int j = 0; j <= k; j++) {
            dp[i][j] = dp[i + 1][j];
            if (j - len >= 0) dp[i][j] |= dp[i + 1][j - len];
        }
    }
}

void z_algo (int ind) {
    int org = s[ind].size();
    s[ind] += '.'; s[ind] += curr;
    int l = 0, r = 0, len = s[ind].size();
    for (int i = 1; i < len; i++) {
        if (r < i) {
            l = r = i;
            while (r < len && s[ind][r - l] == s[ind][r]) r++;
            z[i] = r - l; r--;
        } else {
            int k = i - l;
            if (z[k] < r - i + 1) {
                z[i] = z[k];
            } else {
                l = i;
                while (r < len && s[ind][r - l] == s[ind][r]) r++;
                z[i] = r - l; r--;
            }
        }
    }
    for (int i=0; i<k; i++) {
        z[i] = z[i + org + 1];
    }
}

void calc () {
    for (int i=0; i<k; i++) curr += '{';
    ok[0] = 1;
    for (int i=0; i<n; i++) {
        int len = s[i].size(), ind = -1, d = -1;
        z_algo(i);
        for (int j = 0; j + len <= k; j++) {
            if (!ok[j] || !dp[i+1][k - (j+len)]) continue;
            //if (j + z[j] < k && s[i][j + z[j]] < curr[j + z[j]]) {
            if (s[i] < curr.substr(j, len)) {
                ind = j;
                break;
            }
        }
        if (ind == -1) continue;
        br = ind + len;
        for (int j=0; j<len; j++) {
            if (d == -1 && curr[ind + j] != s[i][j]) d = ind + j;
            curr[ind + j] = s[i][j];
        }
        for (int j=br; j<k; j++) {
            curr[j] = '{';
        }
        for (int j = d + 1; j <= k; j++) {
            ok[j] = 0;
        }
        ok[br] = 1;
        //cout << curr << endl;
        //for (int j=0; j<=k; j++) cout << ok[j]; cout << endl;
    }
}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k;
    for (int i=0; i<n; i++) {
        cin >> s[i];
    }
    precompute();
    calc();
    cout << curr;
    return 0;
}