#include <bits/stdc++.h>
using namespace std;
int ans['z' + 2];
int T['z' + 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int m;
  string s;
  cin >> m >> s;
  int n = s.size();
  set<pair<char, int> > se;
  int d = -1;
  for (int r = 0, l = 0; r < n; ++r) {
    ++T[int(s[r])];
    while (l <= d) {
      se.erase(pair<char, int>(s[l], -l));
      ++l;
    }
    se.insert(pair<char, int>(s[r], -r));
    if (r - l + 1 < m) continue;
    auto x = se.begin();
    ++ans[int(x->first)];
    d = -x->second;
  }
  d = 0;
  for (int i = 'z'; i >= 'a'; --i) {
    if (d || ans[i + 1]) ans[i] = T[i], d = 1;
  }
  for (int i = 'a'; i <= 'z'; ++i) {
    for (int j = 0; j < ans[i]; ++j) cout << char(i);
  }
  cout << endl;
  return 0;
}
