#include <bits/stdc++.h>
using namespace std;
int zi[30], m;
char a[110000];
int main() {
  cin >> m;
  scanf("%s", &a);
  for (int i = 0; i < strlen(a); ++i) zi[a[i] - 'a']++;
  for (char Maxa = 'a'; Maxa <= 'z'; ++Maxa) {
    int sum = 0, wei = -1, maywei = -1, i = 0;
    for (i = 0; i < strlen(a); ++i) {
      if (a[i] < Maxa)
        wei = i;
      else if (a[i] == Maxa)
        maywei = i;
      if (i - wei == m) {
        if (i - maywei < m) {
          sum++;
          wei = maywei;
        } else
          break;
      }
    }
    if (i == strlen(a)) {
      for (char r = 'a'; r < Maxa; ++r) cout << string(zi[r - 'a'], r);
      cout << string(sum, Maxa);
      break;
    }
  }
}
