#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
char s[N];
int x[300], m;
int ok(int l, int r, char c) {
  int R = l + m;
  while (R < r) {
    int f = 0;
    for (int i = R; i > R - m; i--) {
      if (s[i] == c) {
        f = 1;
        R = i + m;
        x[c]++;
        s[i] = '0';
        break;
      }
    }
    if (!f) return 0;
  }
  return 1;
}
int main() {
  int f = 0, len;
  scanf("%d %s", &m, s + 1);
  s[0] = '0';
  len = strlen(s);
  s[len] = '0';
  memset(x, 0, sizeof(x));
  for (char c = 'a'; c <= 'z'; c++) {
    f = 1;
    if (c > 'a')
      for (int i = 1; i < len; i++)
        if (s[i] == c - 1) s[i] = '0', x[c - 1]++;
    for (int i = 1, p = 0; i <= len; i++) {
      if (s[i] == '0') {
        if (i - p > 0 && !ok(p, i, c)) {
          f = 0;
          break;
        }
        p = i;
      }
    }
    if (f) break;
  }
  for (char c = 'a'; c <= 'z'; c++) {
    while (x[c]--) putchar(c);
  }
  printf("\n");
  return 0;
}
