#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  long m;
  std::cin >> m;
  std::string s;
  std::cin >> s;
  long count[26] = {};
  for (int j = 'a'; j <= 'z'; ++j) {
    long max_len = 0;
    long len = 0;
    for (long i = 0; i != (long)s.size(); ++i) {
      if (s[i] > j) {
        max_len = std::max(max_len, ++len);
        continue;
      }
      if (s[i] == j) ++count[j - 'a'];
      len = 0;
    }
    if (max_len < m) {
      long last = 0;
      long len = 0;
      count[j - 'a'] = 0;
      for (long i = 0; i != (long)s.size(); ++i) {
        if (s[i] < j) {
          len = 0;
          continue;
        }
        ++len;
        if (s[i] == j) last = i;
        if (len == m) {
          ++count[j - 'a'];
          len = i - last;
        }
      }
      break;
    }
  }
  for (int i = 0; i != 'z' - 'a' + 1; ++i)
    for (long j = 0; j != count[i]; ++j) std::cout << (char)(i + 'a');
  std::cout << "\n";
  return 0;
}
