#include <bits/stdc++.h>
using namespace std;
bool calc(int n, const string &s, int p) {
  int last = -1, l = -1, sum = 0, len = s.length();
  bool ised = 1;
  for (int i = 0; i < len; ++i) {
    if (s[i] <= p) {
      last = i;
      if (s[i] == p) ++sum;
    }
    if (i - last >= n) ised = 0;
  }
  if (!ised) return cout << string(sum, p), 0;
  last = -1, sum = 0;
  for (int i = 0; i < len; ++i) {
    if (s[i] < p)
      l = i, last = i;
    else if (s[i] == p)
      l = i;
    if (i - last >= n) last = l, ++sum;
  }
  cout << string(sum, p);
  return 1;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 'a'; i <= 'z' && !calc(n, s, i); ++i)
    ;
}
