#include <bits/stdc++.h>
using namespace std;
char ans[100010];
int vis[100010];
int main() {
  int n, tot = 0;
  cin >> n;
  string s;
  cin >> s;
  int st = 0;
  int len = s.length();
  char minn = 'a';
  while (st + n - 1 < len) {
    int k = st;
    char maxx = 'z' + 1;
    int maxid = 0;
    while (k < len && k < st + n) {
      if (maxx >= s[k]) {
        maxx = s[k];
        maxid = k;
      }
      k++;
    }
    ans[tot++] = s[maxid];
    vis[maxid] = 1;
    minn = max(s[maxid], minn);
    st = maxid + 1;
  }
  for (int i = 0; i < s.length(); i++)
    if (!vis[i] && s[i] < minn) ans[tot++] = s[i];
  sort(ans, ans + tot);
  printf("%s\n", ans);
}
