#include <bits/stdc++.h>
inline int F() {
  register int aa, bb, ch;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  ch == '-' ? aa = bb = 0 : (aa = ch - '0', bb = 1);
  while (ch = getchar(), ch >= '0' && ch <= '9') aa = aa * 10 + ch - '0';
  return bb ? aa : -aa;
}
const int Maxn = 100010;
int cnt[26];
char s[Maxn];
int main() {
  int m = F(), flag = 0;
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int i = 0; i <= n; ++i) {
    int lst = 0;
    for (int j = 1; j <= n; ++j) {
      if (j - lst > m) {
        goto End;
      }
      if (s[j] - 'a' <= i) lst = j;
    }
    flag = i;
    break;
  End:
    1;
  }
  int lst = 0, lsti = 0;
  for (int i = 1; i <= n; ++i) {
    if (i - lst > m) {
      ++cnt[flag];
      lst = lsti;
    }
    if (s[i] - 'a' == flag) lsti = i;
    if (s[i] - 'a' < flag) ++cnt[s[i] - 'a'], lst = i;
  }
  if (!flag && !cnt[0])
    puts("a");
  else
    for (int i = 0; i <= flag; ++i)
      while (cnt[i]--) printf("%c", i + 'a');
}
