#include <bits/stdc++.h>
using namespace std;
char str[100005], ans[100005], c;
int main(void) {
  int m, n, k, i, temp, sum, jud, flag;
  scanf("%d%s", &m, str + 1);
  n = strlen(str + 1), k = 0;
  for (c = 'a'; c <= 'z'; c++) {
    sum = jud = flag = 0;
    for (i = 1; i <= n; i++) {
      jud++;
      if (str[i] <= c) jud = 0;
      if (str[i] == c) sum++;
      if (jud >= m) flag = 1;
    }
    if (flag) {
      while (sum--) ans[++k] = c;
    } else {
      jud = 0;
      for (i = 1; i <= n; i++) {
        jud++;
        if (str[i] < c) jud = 0;
        if (str[i] == c) temp = i;
        if (jud >= m) {
          ans[++k] = c;
          jud = i - temp;
        }
      }
      break;
    }
  }
  puts(ans + 1);
  return 0;
}
