#include <bits/stdc++.h>
const double pi = acos(1.0 * (-1));
using namespace std;
const int INF = 2147483647;
const long long mod = 1000000007;
int main() {
  int n;
  string str;
  cin >> n;
  cin >> str;
  int pos = -1;
  for (int i = 0; i < 26; i++) {
    int now = 0;
    bool flag = true;
    for (int j = 0; j < str.length(); j++) {
      if (str[j] - 'a' <= i)
        now = 0;
      else
        now++;
      if (now >= n) {
        flag = false;
        break;
      }
    }
    if (flag) {
      pos = i;
      break;
    }
  }
  int now = 0;
  int last = -1;
  int sum = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] - 'a' == pos) last = i;
    if (str[i] - 'a' >= pos) {
      now++;
      if (now >= n) {
        sum++;
        i = last;
        now = 0;
      }
    } else
      now = 0;
  }
  vector<int> res;
  for (int i = 0; i < str.length(); i++)
    if (str[i] - 'a' < pos) res.push_back(str[i] - 'a');
  for (int i = 0; i < sum; i++) res.push_back(pos);
  sort(res.begin(), res.end());
  for (int i = 0; i < res.size(); i++) cout << (char)('a' + res[i]);
  return 0;
}
