#include <bits/stdc++.h>
using namespace std;
int vis[100005];
string ans;
int cnt[27];
int main() {
  int n, m;
  string s;
  cin >> m >> s;
  n = s.size();
  for (int i = int(0); i <= int(n - 1); i++) cnt[s[i] - 'a']++;
  for (int j = int(0); j <= int(25); j++) {
    int mx = -1, prev = -1;
    char ch = j + 'a';
    vector<int> v;
    bool flag = true;
    for (int i = int(0); i <= int(n - 1); i++) {
      if (s[i] == ch) mx = i;
      if (vis[i]) prev = i;
      if (i - m >= prev) {
        prev = mx;
        if (i - m >= prev) {
          for (int k = int(0); k <= int(cnt[j] - 1); k++) {
            ans += ch;
          }
          for (int i = int(0); i <= int(n - 1); i++) {
            if (s[i] == ch) vis[i] = 1;
          }
          flag = false;
          break;
        } else {
          v.push_back(mx);
        }
      }
    }
    if (flag) {
      for (int i = int(0); i <= int(v.size() - 1); i++) {
        vis[v[i]] = 1;
        ans += s[v[i]];
      }
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
