#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, INF = 1e9 + 5;
int n, m, a[300];
char s[N];
bool sol(char c) {
  int last = 0, cnt = 0, lc = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == c) lc = i;
    if (s[i] < c) last = i;
    if (i - last >= m) {
      if (i - lc < m)
        last = lc, cnt++;
      else
        return false;
    }
  }
  for (int i = 1; i <= n; i++) a[s[i]]++;
  for (char now = 'a'; now < c; now++) {
    while (a[now]--) putchar(now);
  }
  while (cnt--) putchar(c);
  return true;
}
int main() {
  scanf("%d%s", &m, s + 1);
  n = strlen(s + 1);
  for (char c = 'a'; c <= 'z'; c++)
    if (sol(c)) break;
}
