#include <bits/stdc++.h>
using namespace std;
int visit[100010];
int m;
char s[100010], newstr[100010];
int now, pos;
int main() {
  scanf("%d", &m);
  cin >> s;
  int length = strlen(s);
  now = 0;
  int count = 0;
  char maxchar = 'a' - 1;
  while (now + m <= length) {
    pos = now;
    for (int i = 1 + now; i < m + now; i++) {
      if (s[i] <= s[pos]) pos = i;
    }
    visit[pos] = 1;
    newstr[count++] = s[pos];
    maxchar = max(maxchar, s[pos]);
    now = pos + 1;
  }
  for (int i = 0; i < length; i++) {
    if (!visit[i] && s[i] < maxchar) {
      newstr[count++] = s[i];
    }
  }
  sort(newstr, newstr + count);
  cout << newstr << endl;
  return 0;
}
