#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
char s[MAXN];
int m, n;
vector<int> ve[60];
set<pair<int, int> > st;
char ans[MAXN];
int sz = 0;
int main() {
  cin >> m;
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; i++) ve[s[i] - 'a'].push_back(i);
  st.insert({0, n - m});
  for (int i = 0; i < 30; i++) {
    set<pair<int, int> >::iterator it = st.begin();
    int l = 0, r = 0, cnt = 0;
    for (int j = 0; j < ve[i].size(); j++) {
      if (it == st.end()) break;
      l = it->first, r = it->second;
      while (r + m <= ve[i][j]) {
        ++it;
        if (it == st.end()) break;
        l = it->first, r = it->second;
      }
      if ((r + m) <= ve[i][j]) break;
      if (ve[i][j] < l) continue;
      if (j + 1 < ve[i].size() && ve[i][j + 1] <= l + m - 1)
        continue;
      else {
        cnt++;
        st.erase(it);
        if (ve[i][j] - m >= l) st.insert({l, ve[i][j] - m});
        if (ve[i][j] + 1 <= r) st.insert({ve[i][j] + 1, r});
        it = st.lower_bound({ve[i][j] + 1, -1});
      }
    }
    if (st.size() > 0) cnt = ve[i].size();
    for (int j = 0; j < cnt; j++) ans[sz++] = 'a' + i;
    if (st.size() == 0) break;
  }
  printf("%s\n", ans);
  return 0;
}
