#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
const long long inf = 0x3f3f3f3f;
string s;
int m;
bool in[maxn];
int main() {
  cin >> m;
  cin >> s;
  int len = s.size();
  int now = 0;
  int mi, ma = 0, pos;
  while (now + m - 1 <= len - 1) {
    mi = inf;
    for (int i = now; i <= now + m - 1; i++) {
      if (mi >= s[i]) mi = s[i], pos = i;
    }
    in[pos] = true;
    if (ma < mi) ma = mi;
    now = pos + 1;
  }
  for (int i = 0; i < len; i++) {
    if (s[i] < ma && !in[i]) in[i] = true;
  }
  string ans;
  for (int i = 0; i < len; i++) {
    if (in[i]) ans.push_back(s[i]);
  }
  sort(ans.begin(), ans.end());
  cout << ans;
  return 0;
}
