#include <bits/stdc++.h>
using namespace std;
string str, ans;
int n, k;
set<int> Pos[256], NotSolved;
void GoFor(int i) {
  ans += str[i];
  while (true) {
    auto it = NotSolved.lower_bound(i);
    if (it == NotSolved.end() || (*it) >= (i + k)) break;
    NotSolved.erase(it);
  }
}
bool SolveGreedy(int c) {
  while (NotSolved.size()) {
    auto it = NotSolved.begin();
    auto it2 = Pos[c].upper_bound(*it);
    if (it2 == Pos[c].begin()) return false;
    --it2;
    if (*it2 <= *it - k) return false;
    GoFor(*it2);
    Pos[c].erase(it2);
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> k;
  cin >> str;
  n = str.length();
  for (int i = 0; i < n; ++i) {
    Pos[str[i]].insert(i);
  }
  for (int i = k - 1; i < n; ++i) NotSolved.insert(i);
  for (int c = 'a'; c <= 'z'; ++c) {
    if (!SolveGreedy(c)) {
      while (Pos[c].size()) {
        auto it = Pos[c].begin();
        GoFor(*it);
        Pos[c].erase(it);
      }
    } else
      break;
  }
  cout << ans << endl;
  return 0;
}
