#include<cstdio>
#include<iostream>
#include<cstring>
#include<bitset>
#define mp(a,b) make_pair(a,b)
using namespace std;
bitset<10010> can[2010];
pair<int,int> vis[2][10010];
char s[2010][10010],ans[1000010];
int len[2010],n,k,cnt,ncnt;
int main()
{
    scanf("%d%d",&n,&k);
    for (int i=1;i<=n;i++) scanf("%s",s[i]),len[i]=strlen(s[i]);
    can[n+1][0]=1;
    for (int i=n;i>=1;i--)
        can[i]=can[i+1]|(can[i+1]<<len[i]);
    for (int i=1;i<=n;i++)
        if (can[i+1][k-len[i]]) vis[0][++cnt]=mp(i,0);
    int ii=0;
    for (int i=0;i<k;i++)
    {
        char minc='z';
        for (int j=1;j<=cnt;j++) minc=min(minc,s[vis[ii][j].first][vis[ii][j].second]);
        ans[i]=minc;
        int minid=n+1;
        ncnt=0;
        for (int j=1;j<=cnt;j++)
        {
            int nid=vis[ii][j].first,nlen=vis[ii][j].second;
            if (s[nid][nlen]!=minc) continue;
            if (nlen+1==len[nid]) minid=min(minid,nid);
            else vis[ii^1][++ncnt]=mp(nid,nlen+1);
        }
        for (int j=minid+1;j<=n;j++)
            if (k-len[j]-i-1>=0&&can[j+1][k-len[j]-i-1]) vis[ii^1][++ncnt]=mp(j,0);
        ii^=1;
        cnt=ncnt;
    }
    printf("%s",ans);
}