#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  scanf("%d", &m);
  char s[100005];
  scanf("%s", s);
  multiset<char> ans;
  multiset<char>::iterator it;
  int l = strlen(s);
  bool taken[l];
  memset(taken, false, sizeof(taken));
  char Max = 'a';
  int ind;
  for (int i = 0; i <= l - m; i++) {
    ind = i;
    for (int j = i + 1; j < i + m && j < l; j++)
      if (s[ind] >= s[j]) ind = j;
    if (s[ind] > Max) Max = s[ind];
    taken[ind] = true;
    ans.insert(s[ind]);
    i = ind;
  }
  for (int i = 0; i < l; i++)
    if (!taken[i] && s[i] < Max) ans.insert(s[i]);
  for (it = ans.begin(); it != ans.end(); ++it) cout << (*it);
  return 0;
}
