#include <bits/stdc++.h>
using namespace std;
int n, m;
int Q[100005], cnt[26];
char str[100005];
int main() {
  scanf("%d %s", &m, str);
  n = strlen(str);
  int L = 0, R = 0, i = 0, l = -m;
  while (i < n) {
    while (L < R && Q[L] < i) L++;
    for (int j = l + m; j < i + m; j++) {
      while (L < R && str[Q[R - 1]] >= str[j]) R--;
      Q[R++] = j;
    }
    cnt[str[Q[L]] - 'a']++;
    if (Q[L] + m >= n) break;
    l = i, i = Q[L] + 1;
  }
  for (i = 25; i >= 0; i--)
    if (cnt[i]) break;
  sort(str, str + n);
  for (int j = 0; j < n; j++) {
    putchar(str[j]);
    if (str[j] == i + 'a' && --cnt[i] == 0) break;
  }
  return 0;
}
