#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  string s;
  cin >> m >> s;
  vector<bool> sel(s.size());
  int last = -1;
  char maxch = 0;
  while (last + m < (int)s.size()) {
    auto it = min_element(s.rend() - 1 - (last + m), s.rend() - 1 - last);
    last = s.rend() - 1 - it;
    sel[last] = true;
    maxch = max(maxch, *it);
  }
  vector<int> indices;
  indices.reserve(s.size());
  for (size_t i = 0; i < s.size(); ++i) {
    if (sel[i] || s[i] < maxch) {
      indices.push_back(i);
    }
  }
  for (char ch = 'a'; ch <= 'z'; ++ch) {
    for (int index : indices) {
      if (s[index] == ch) {
        cout << ch;
      }
    }
  }
  cout << endl;
  return 0;
}
