#include <bits/stdc++.h>
using namespace std;
int M;
bool cover(const string str, vector<char>& used, char smallest) {
  int len = ((int)str.size());
  int life = M;
  for (int i = 0; i < (int)(len); ++i) {
    if (used[i] || str[i] == smallest)
      life = M;
    else
      life -= 1;
    if (life == 0) return false;
  }
  auto covered = used;
  life = M;
  int candidate = -1;
  for (int i = 0; i < (int)(len); ++i) {
    if (covered[i]) {
      life = M;
    } else if (str[i] == smallest) {
      if (life == 1) {
        used[i] = smallest;
        life = M;
      } else {
        candidate = i;
        --life;
      }
    } else {
      --life;
      if (life == 0) {
        used[candidate] = smallest;
        i = candidate;
        life = M;
      }
    }
  }
  return true;
}
int main(void) {
  cin.sync_with_stdio(false);
  cin >> M;
  string str;
  cin >> str;
  vector<char> used(((int)str.size()), 0);
  char smallest = 'a';
  while (true) {
    if (cover(str, used, smallest)) {
      break;
    } else {
      for (int i = 0; i < (int)(((int)str.size())); ++i) {
        if (str[i] == smallest) {
          used[i] = smallest;
        }
      }
      smallest += 1;
    }
  }
  vector<char> ans;
  for (int i = 0; i < (int)(((int)str.size())); ++i) {
    if (used[i]) ans.push_back(used[i]);
  }
  sort((ans).begin(), (ans).end());
  for (auto ch : ans) cout << ch;
  cout << endl;
  return 0;
}
