#ifdef _WIN32 # define LL "%I64d" #else # define LL "%Ld" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define null NULL #define mp make_pair #define pb(a) push_back(a) #define sz(a) ((int)(a).size()) #define all(a) a.begin() , a.end() #define fi first #define se second #define relaxMin(a , b) (a) = min((a),(b)) #define relaxMax(a , b) (a) = max((a),(b)) #define SQR(a) ((a)*(a)) typedef vector vi; typedef pair pii; typedef long long ll; int N , K; string in; map nal; string out; char buf[10000]; int main(){ freopen("letters.in" , "r" , stdin); freopen("letters.out" , "w" , stdout); scanf("%d%d" , &N , &K); scanf("%s" , &buf); in = string(buf); for(int i=0;i::iterator it = nal.begin(); it != nal.end(); ++it){ if(K > 0){ out += it->fi; --it->se; --K; } } for(map::iterator it = nal.begin(); it != nal.end(); ++it){ while(K > 0 && it->se > 0){ out += it->fi; --it->se; --K; } } sort(all(out)); printf("%s\n" , out.c_str()); return 0; }