#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
vector<int> v[26];
int a[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m;
  cin >> m;
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    v[s[i] - 'a'].push_back(i);
    a[i] = 1;
  }
  for (int i = 25; i >= 0; i--) {
    for (int x : v[i]) a[x] = 0;
    int sum = 0;
    bool flag = true;
    for (int j = 0; j < n; j++) {
      sum += a[j];
      if (j >= m) sum -= a[j - m];
      if (j >= m - 1 && sum == 0) {
        flag = false;
        break;
      }
    }
    if (flag) continue;
    sum = 0;
    int idx = 0;
    for (int j = 0; j < n; j++) {
      if (idx < (int)v[i].size() && v[i][idx] == j) idx++;
      sum += a[j];
      if (j >= m) sum -= a[j - m];
      if (j >= m - 1 && sum == 0) {
        sum++;
        a[v[i][idx - 1]] = 1;
      }
    }
    break;
  }
  string ans;
  for (int i = 0; i < n; i++)
    if (a[i]) ans += s[i];
  sort(ans.begin(), ans.end());
  cout << ans;
  return 0;
}
