#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
char A[100004];
int P[26];
int CNT[26];
int main() {
  int m;
  scanf("%d", &m);
  scanf("%s", A);
  int n = strlen(A);
  int st = 0, cnt = 0, l = 0;
  for (l = 0; l <= 25; l++) {
    st = 0, cnt = 0;
    for (; st <= n - m; st++) {
      int i = st;
      for (int j = 0; j <= l; j++) P[j] = -1;
      while (i < n && i < st + m) P[A[i] - 'a'] = i++;
      st = -1;
      for (int j = 0; j < l; j++) st = max(st, P[j]);
      if (st == -1) {
        if (P[l] == -1)
          break;
        else
          st = P[l], cnt++;
      }
    }
    if (st != -1) break;
  }
  for (int i = 0; i < n; i++) CNT[A[i] - 'a']++;
  for (int i = 0; i < l; i++)
    for (int j = 0; j < CNT[i]; j++) printf("%c", i + 'a');
  for (int i = 0; i < cnt; i++) printf("%c", l + 'a');
  printf("\n");
  return 0;
}
