#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int v[30];
char s[N];
int m;
int main() {
  scanf("%d", &m);
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  char maxc = 'a';
  for (int i = 1; i <= len - m + 1; ++i) {
    char u = 'z';
    int nextpos = -1;
    for (int j = i; j <= i + m - 1; ++j) {
      if (s[j] <= u) {
        u = s[j];
        nextpos = j;
      }
    }
    if (nextpos != -1) {
      v[u - 'a']++;
      s[nextpos] = '.';
      if (u > maxc) maxc = u;
      i = nextpos;
    }
  }
  for (int i = 1; i <= len; ++i) {
    if (s[i] != '.' && s[i] < maxc) v[s[i] - 'a']++;
  }
  for (int i = 0; i < 26; ++i) {
    while (v[i]--) {
      printf("%c", i + 'a');
    }
  }
  printf("\n");
  return 0;
}
