#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = 1LL * INF * INF;
const int MAX = 20004;
int m;
string s;
multiset<pair<char, int> > q;
string solve(char up) {
  int p = -1;
  string res = "";
  int lastUp = -1;
  for (int i = (0); i < ((int)s.size() + 1); ++i) {
    if (i - p > m) {
      if (lastUp > p && i - lastUp <= m) {
        res += s[lastUp];
        p = lastUp;
      } else {
        return "";
      }
    }
    if (i == (int)s.size()) break;
    if (s[i] < up) {
      res += s[i];
      p = i;
    }
    if (s[i] == up) lastUp = i;
  }
  sort(res.begin(), res.end());
  return res;
}
int main() {
  cin >> m >> s;
  for (int up = ('a'); up < ('z' + 1); ++up) {
    string ans = solve(up);
    if (ans != "") {
      cout << ans;
      return 0;
    }
  }
  return 0;
}
