import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

const long MOD = 998244353;
const long INF = 1L << 59;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto K = s[1];
    auto S = N.iota.map!(_ => readln.chomp).array;
    auto dp = new int[][](K+1);

    foreach (i; 0..N) {
        int len = S[i].length.to!int;
        foreach_reverse (j; 0..K+1-len) {
            if (dp[j].empty && j != 0) {
                continue;
            } else if (dp[j + len].empty) {
                dp[j + len] = dp[j].dup ~ i;
            } else {
                auto ns = dp[j].dup ~ i;
                bool upd = false;
                for (int a = 0, ai = 0, b = 0, bi = 0, k = 0; k < j + len; ++ai, ++bi, ++k) {
                    if (ai >= S[ns[a]].length) {
                        ++a;
                        ai = 0;
                    }
                    if (bi >= S[dp[j + len][b]].length) {
                        ++b;
                        bi = 0;
                    }
                    if (S[ns[a]][ai] < S[dp[j + len][b]][bi]) {
                        upd = true;
                        break;
                    } else if (S[ns[a]][ai] > S[dp[j + len][b]][bi]) {
                        break;
                    }
                }
                if (upd) {
                    dp[j + len] = ns;
                }
            }
        }
    }

    string ans = "";
    foreach (i; dp[K]) ans ~= S[i];
    ans.writeln;
}
