#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
string in;
class compare {
 public:
  bool operator()(int a, int b) {
    if (in[a] == in[b]) return a > b;
    return in[a] < in[b];
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  set<int, compare> s;
  int count[26], ans[26];
  int m, i, j;
  int maxi;
  cin >> m >> in;
  memset(count, 0, sizeof count);
  memset(ans, 0, sizeof ans);
  for (i = 0; i < in.size(); i++) {
    count[in[i] - 'a']++;
  }
  for (j = 0; j < min(m, (int)in.size()); j++) {
    s.insert(j);
  }
  i = 0;
  maxi = 0;
  if (j >= in.size()) {
    for (i = 0; i < 26; i++) {
      if (count[i]) printf("%c\n", i + 'a');
      return 0;
    }
  }
  while (j < in.size()) {
    int at = *s.begin();
    maxi = max(in[at] - 'a', maxi);
    s.erase(at);
    while (i <= at) {
      s.erase(i);
      i++;
      if (j < in.size()) {
        s.insert(j);
        j++;
      }
    }
    ans[in[at] - 'a']++;
  }
  int print = 0;
  for (i = 0; i < maxi; i++) {
    while (count[i]--) {
      printf("%c", i + 'a');
    }
  }
  while (ans[i]--) {
    printf("%c", i + 'a');
  }
  printf("\n");
  return 0;
}
