#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
vector<int> pos[26];
char s[MAXN + 10];
int l[MAXN + 10], r[MAXN + 10];
int main() {
  int n, m;
  scanf("%d%s", &m, s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) l[i] = i - 1, r[i] = i + 1;
  r[0] = 1;
  for (int i = 1; i <= n; i++) pos[s[i] - 'a'].push_back(i);
  for (int i = 25; i >= 0; i--) {
    int sz = pos[i].size();
    int cnt = 0;
    for (int j = 0; j < sz; j++) {
      int del_len = r[pos[i][j]] - l[pos[i][j]];
      if (del_len > m) continue;
      r[l[pos[i][j]]] = r[pos[i][j]];
      l[r[pos[i][j]]] = l[pos[i][j]];
      cnt++;
    }
    if (cnt != sz) break;
  }
  int u = 0;
  vector<char> vec;
  while (u <= n) {
    if (u != 0) vec.push_back(s[u]);
    u = r[u];
  }
  sort(vec.begin(), vec.end());
  int vsz = vec.size();
  for (int i = 0; i < vsz; i++) printf("%c", vec[i]);
  printf("\n");
  return 0;
}
