#include <bits/stdc++.h>
using namespace std;
int ch[100002];
int main() {
  ios_base::sync_with_stdio(0);
  int i, j, x, n, cnt = 0, m, y, k, g, flg, p;
  string s, cs, an;
  cin >> m >> s;
  char mc = 'A';
  for (i = 0; i <= s.size() - m; i++) {
    char c = '|';
    p = i;
    for (j = i; j <= i + m - 1; j++) {
      if (s[j] < c) {
        c = s[j];
        p = j;
      } else if (s[j] == c) {
        p = j;
      }
    }
    an += c;
    mc = max(c, mc);
    i = p;
    ch[p] = 1;
  }
  for (i = 0; i <= s.size() - 1; i++) {
    if (!ch[i] && s[i] < mc) an += s[i];
  }
  sort(an.begin(), an.end());
  cout << an;
}
