#include <bits/stdc++.h>
int nxt[100005];
char s[100005];
int main() {
  int n, m;
  scanf("%d\n%s", &m, s + 1);
  n = strlen(s + 1);
  int num, i;
  for (i = 0; i < 26; i++) {
    int last = n + 1, j;
    for (j = n; j >= 1; j--) {
      nxt[j] = last;
      if (s[j] - 'a' <= i) last = j;
    }
    last = num = 0;
    for (j = 1; j <= n; j++)
      if (s[j] - 'a' > i && j - last >= m)
        break;
      else if (s[j] - 'a' == i && nxt[j] - last <= m)
        continue;
      else if (s[j] - 'a' <= i)
        last = j, num += (s[j] - 'a') == i;
    if (j > n) break;
    for (j = 1; j <= n; j++)
      if (s[j] - 'a' == i) printf("%c", s[j]);
  }
  for (int j = 1; j <= num; j++) printf("%c", 'a' + i);
}
