#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
const int M = 26;
int tot[M];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int m;
  cin >> m;
  string s;
  cin >> s;
  int n = s.size();
  for (char c : s) {
    tot[c - 'a']++;
  }
  int last = -1;
  for (int c = 0; c < M; c++) {
    int cur = -1;
    for (int i = 0; i < n; i++) {
      if (s[i] - 'a' <= c) {
        if (i - cur > m) {
          break;
        } else {
          cur = i;
        }
      }
    }
    if (n - cur > m) {
      continue;
    } else {
      last = c;
      break;
    }
  }
  assert(last != -1);
  vector<int> idc, idx;
  for (int i = 0; i < n; i++) {
    if (s[i] - 'a' == last) {
      idc.push_back(i);
    } else if (s[i] - 'a' < last) {
      idx.push_back(i);
    }
  }
  idx.push_back(n);
  function<int(int, int)> solve = [&](int l, int r) {
    int res = 0;
    int rb = r;
    while (rb - l > m) {
      rb = *lower_bound(idc.begin(), idc.end(), rb - m);
      res++;
    }
    return res;
  };
  int pre = -1;
  int cnt = 0;
  for (int i : idx) {
    cnt += solve(pre, i);
    pre = i;
  }
  for (int i = 0; i < last; i++) {
    while (tot[i]--) {
      cout << (char)(i + 'a');
    }
  }
  while (cnt--) {
    cout << (char)(last + 'a');
  }
  cout << nl;
  return 0;
}
