#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
char s[MAXN];
int main() {
  int m;
  scanf("%d", &m);
  scanf("%s", s);
  int n = strlen(s);
  priority_queue<int, vector<int>, greater<int> > Q;
  for (int k = 0; k < 26; k++) {
    while (!Q.empty()) Q.pop();
    bool flag;
    for (int i = 0; i <= n - 1; i++) {
      flag = 0;
      int tmp = 0;
      for (int j = i; j <= i + m - 1 && j < n; j++) {
        if (s[j] - 'a' < k) Q.push(s[j]), flag = 1, tmp = j;
      }
      if (i > n - m) {
        flag = 1;
        break;
      }
      if (!flag) {
        for (int j = i + m - 1; j >= i; j--) {
          if (s[j] - 'a' == k) {
            Q.push(s[j]), flag = 1;
            tmp = j;
            break;
          }
        }
        if (!flag) break;
      }
      i = tmp;
    }
    if (flag) {
      while (!Q.empty()) {
        printf("%c", Q.top());
        Q.pop();
      }
      break;
    }
  }
  return 0;
}
