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;
int n, k;
const int maxn = 2005;
const int maxk = 10005;
const int maxc = 1e6 + 20;
int len[maxn];
int start[maxn];

bitset<maxk> can[maxn];
int ss[maxc];
int critical[maxc];

int loc[2][maxc];

int main(){
  memset(critical, -1, sizeof(critical));
  scanf("%d%d\n", &n, &k);
  int tt = 0;
  vector<bool> appr(26);
  for(int i=0;i<n;i++){
    //string s; getline(cin, s);
    string s; cin >> s;
    len[i] = s.length();
    start[i] = tt;
    critical[tt] = i;
    for(int e=0;e<s.length();e++){
      int c = s[e] - 'a';
      appr[c] = true;
      ss[tt] = c;
      tt++;
    }
  }
  int numappr = 0;
  for(int i=0;i<26;i++)if(appr[i]) numappr++;
  if(numappr == 1){
    for(int i=0;i<26;i++){
      if(appr[i]){
	cout << string(k, (i + 'a')) << "\n";
	return 0;
      }
    }
  }
  
  can[n][0] = true;
  for(int i=n-1;i>=0;i--){
    can[i] = can[i+1] | (can[i+1]<<len[i]);
  }

  int q = 0;
  int cnt = 0;
  
  for(int i=0;i<n;i++){
    if(can[i+1][k-len[i]]) loc[q][cnt++] = start[i];
  }
  string ans = "";

  
  for(int eee = 0; eee < k; eee++){
    int mn = 1e9;
    for(int i=0;i<cnt;i++){
      int x = loc[q][i];
      mn = min(mn, ss[x]);
    }
    ans.push_back(mn + 'a');
    int mnn = 1e9;
    int ncnt = 0;
    for(int i=0;i<cnt;i++){
      int x = loc[q][i];
      if(ss[x] != mn) continue;
      if(critical[x+1] != -1){
	mnn = min(mnn, critical[x+1]);
      }
      else{
	loc[q ^ 1][ncnt++] = x + 1;
      }
    }
    if(mnn != 1e9){
      for(int i = mnn; i < n; i++){
	if(k-eee-1-len[i]>=0 && can[i+1][k-eee-1-len[i]]) loc[q ^ 1][ncnt++] = start[i];
      }
    }

    q ^= 1;
    cnt = ncnt;
  }
  cout << ans << "\n";
}