#include <bits/stdc++.h>
using namespace std;
int m;
string s;
int hs[300000];
int tail, frt;
int main() {
  cin >> m;
  cin >> s;
  char c = 'a';
  m--;
  for (; c <= 'z'; ++c) {
    deque<int> Q;
    int i = 0;
    int j = 0;
    bool flag = true;
    Q.push_back(0);
    while (i < s.size() && j < s.size()) {
      while (j < s.size() && (j - i) < m) {
        ++j;
        while (!Q.empty() && s[Q.front()] >= s[j]) Q.pop_front();
        Q.push_front(j);
      }
      if (j >= s.size()) break;
      if ((j - i) == m) {
        while (!Q.empty() && Q.back() < i) Q.pop_back();
        if (s[Q.back()] > c) flag = false;
      }
      ++i;
    }
    if (flag) break;
  }
  vector<char> ans;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] < c) ans.push_back(s[i]);
  }
  {
    deque<int> Q;
    int i = 0;
    int j = 0;
    bool flag = false;
    Q.push_back(0);
    int last = -1;
    if (s[0] == c) last = 0;
    while (i < s.size() && j < s.size()) {
      while (j < s.size() && (j - i) < m) {
        ++j;
        while (!Q.empty() && s[Q.front()] >= s[j]) Q.pop_front();
        Q.push_front(j);
        if (s[j] == c) last = j;
      }
      if (j >= s.size()) break;
      if ((j - i) == m) {
        while (!Q.empty() && Q.back() < i) Q.pop_back();
        if (s[Q.back()] == c && flag == false) {
          hs[last] = 1;
          ans.push_back(c);
          flag = true;
        }
      }
      if (hs[i] == 1) flag = false;
      ++i;
    }
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); ++i) cout << ans[i];
    cout << endl;
  }
  return 0;
}
