#include <bits/stdc++.h>
using namespace std;
vector<bool> arr;
int main() {
  int m;
  scanf("%d", &m);
  string str;
  cin >> str;
  int n = str.length();
  int s = n - m + 1;
  arr.resize(s);
  string jaw = "";
  for (int c = 0; c < 26; ++c) {
    bool flag = true;
    int count = 0;
    int maxi = -1;
    for (int i = 0; i < s; ++i) {
      if (arr[i]) continue;
      if (maxi >= i) {
        arr[i] = true;
        continue;
      }
      maxi = -1;
      for (int j = i + m - 1; j >= i; --j) {
        if (str[j] == c + 'a') {
          maxi = j;
          arr[i] = true;
          ++count;
          break;
        }
      }
      if (maxi == -1) {
        flag = false;
      }
    }
    if (flag) {
      for (int i = 0; i < count; ++i) {
        jaw += c + 'a';
      }
      printf("%s\n", jaw.c_str());
      return 0;
    }
    for (int i = 0; i < n; ++i) {
      if (str[i] == c + 'a') jaw += c + 'a';
    }
  }
  printf("%s\n", jaw.c_str());
}
