#include<iostream>
#include<algorithm>
using namespace std;
struct node
{
  string a;
  int t,num,len;
  bool operator < (const node &s)const
  {
    return a<s.a;
  }
};
node ts[2001];
bool dp[10001];
int pv[10001];
bool cmp(node t1,node t2)
{
  return t1.t<t2.t;
}
int tong[10001],length;
int main()
{
  int n,k;
  cin>>n>>k;
  for (int i=1;i<=n;++i)
    {
      ts[i].t=i;
      cin>>ts[i].a;
      ts[i].len=ts[i].a.length();
    }
  sort(ts+1,ts+n+1);
  dp[0]=1;
  for (int j=1;j<=n;++j)
    for (int i=k;i>=ts[j].len;--i)
      {
	if (dp[i]==0&&dp[i-ts[j].len]==1)
	    pv[i]=ts[j].len;
         dp[i]|=dp[i-ts[j].len];
      }
  int y=k;
  while (y!=0)
    {
      tong[++length]=pv[y];
      y-=pv[y];
    }
  for (int i=1;i<=length;++i)
    cout<<ts[i].a;
  cout<<endl;
  return 0;
}