#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int NAX = 2e5 + 5, MOD = 1000000007;
void solveCase() {
  int m;
  cin >> m;
  string str;
  cin >> str;
  int n = str.size();
  vector<vector<int>> cnt(n, vector<int>(26));
  vector<int> poses[26];
  for (size_t i = 0; i < n; i++) {
    poses[str[i] - 'a'].push_back(i);
    if (i > 0) cnt[i] = cnt[i - 1];
    cnt[i][str[i] - 'a']++;
  }
  for (int c = 0; c < 26; c++) {
    if (poses[c].empty()) continue;
    string res;
    int now = 0;
    int prev = -1;
    bool golbOk = true;
    while (now < n) {
      int cc = str[now] - 'a';
      ;
      if (cc < c) {
        ;
        prev = now;
        ++now;
      } else if ((now - prev) >= m) {
        ;
        int j = now;
        int cnt = m;
        bool ok = false;
        while (j >= 0 && cnt > 0) {
          if (str[j] == ('a' + c)) {
            res.push_back(str[j]);
            ok = true;
            prev = j;
            break;
          }
          --cnt;
          --j;
        }
        ++now;
        if (!ok) {
          golbOk = false;
          break;
        }
      } else
        now++;
    }
    if (golbOk) {
      string res2;
      for (int c1 = 0; c1 < c; c1++)
        for (size_t i = 0; i < poses[c1].size(); i++) res2.push_back(c1 + 'a');
      ;
      cout << res2 << res << '\n';
      return;
    }
  }
  assert(false);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) solveCase();
  return 0;
}
