#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
int len = (n + k - 1) / k;
int c = n % k;
if (c == 0) c = k;
string s;
cin >> s;
sort(s.begin(), s.end());
int ptr = 0;
while(len--)
{
int cc = 0;
for(int j = 0; j < c; j++)
{
if (j != 0 && s[ptr] == s[ptr - 1])
{
++ cc;
}
else
{
cc = 1;
}
++ ptr;
}
c = cc;
cout << s[ptr - 1];
}
cout << endl;
return 0;
}