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;

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 L = S.map!(s => s.length.to!int).array;

    auto used = new bool[](K+1);
    auto ok = new bool[][](N+1, K+1);
    used[K] = true;
    ok[N][K] = true;

    foreach_reverse (i; 0..N) {
        int[] tmp;
        foreach (j; 0..K+1-L[i]) {
            if (used[j+L[i]]) {
                ok[i][j] = true;
                tmp ~= j;
            }
        }
        foreach (j; tmp) {
            used[j] = true;
        }
    }


    auto rank = new int[](N);
    auto T = N.iota.map!(i => tuple(S[i], i)).array;
    T.sort();
    foreach (i; 0..N) rank[T[i][1]] = i;

    auto lcp = new int[][](N, N);
    foreach (i; 0..N)
        lcp[i][i] = L[i];
    foreach (i; 0..N-1)
        for (int j = 0; j < min(T[i][0].length, T[i+1][0].length) && T[i][0][j] == T[i+1][0][j]; ++j)
            ++lcp[i][i+1];
    foreach (i; 0..N)
        foreach (j; i+1..N)
            lcp[i][j] = min(lcp[i][j], lcp[j-1][j]);

    //T.writeln;
    //lcp.each!writeln;

    auto pq = new BinaryHeap!(Array!(Tuple!(int, int, string)), "a[1] > b[1]")();
    pq.insert(tuple(0, 0, ""));

    string ans = "~";

    while (!pq.empty) {
        int i = pq.front[0];
        int j = pq.front[1];
        string tmp = pq.front[2];
        pq.popFront;
        int best_rank = 1 << 29;
        int[] best_index;
        bool[int] hoge;
        for (int r = 0; r < N; ++r) {
            if (T[r][1] < i || !ok[T[r][1]][j]) {
                continue;
            }
            if (best_rank == 1 << 29) {
                best_rank = r;
                best_index ~= T[r][1];
                hoge[T[r][0].length.to!int] = true;
            } else if (lcp[best_rank][r] >= T[best_rank][0].length.to!int && T[r][0].length.to!int !in hoge) {
                best_index ~= T[r][1];
                hoge[T[r][0].length.to!int] = true;
            }
        }
        foreach (k; best_index) {
            if (j + S[k].length == K) {
                ans = min(ans, tmp ~ S[k]);
            } else {
                pq.insert(tuple(k + 1, j + S[k].length.to!int, tmp ~ S[k]));
            }
        }
    }

    ans.writeln;
}
