#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int m, ans[26];
char s[MAXN];
bool vis[MAXN];
pair<int, int> cnt[26];
int main() {
  scanf("%d%s", &m, s);
  for (int i = 0; i < m; i++)
    cnt[s[i] - 'a'].first++, cnt[s[i] - 'a'].second = i;
  for (int l = 0, r = m - 1, len = strlen(s), pos = -1; r < len;) {
    if (l <= pos) {
      if (r == len - 1) break;
      cnt[s[l++] - 'a'].first--;
      cnt[s[++r] - 'a'].first++, cnt[s[r] - 'a'].second = r;
      continue;
    }
    for (int i = 0; i < 26; i++)
      if (cnt[i].first) {
        ans[i]++, pos = cnt[i].second, vis[pos] = 1;
        break;
      }
    if (r == len - 1) break;
    cnt[s[l++] - 'a'].first--;
    cnt[s[++r] - 'a'].first++, cnt[s[r] - 'a'].second = r;
  }
  int flag;
  for (int i = 25; i >= 0; i--)
    if (ans[i]) {
      flag = i;
      break;
    }
  for (int i = 0, len = strlen(s); i < len; i++)
    if (!vis[i] && (s[i] - 'a' < flag)) ans[s[i] - 'a']++;
  for (int i = 0; i < 26; i++)
    while (ans[i]) putchar('a' + i), ans[i]--;
  return 0;
}
