#include <bits/stdc++.h>
using namespace std;
char s[300005];
int minn[300005][20], ans[300005];
int a[30];
int p[300005];
int main() {
  int n;
  scanf("%d", &n);
  cin >> s + 1;
  int len = strlen(s + 1);
  memset(minn, 0x3f, sizeof(minn));
  for (int i = 1; i <= len; i++) {
    a[s[i] - 'a']++;
    minn[i][0] = s[i];
  }
  for (int i = 1; i <= 18; i++) {
    for (int j = 1; j <= len; j++)
      minn[j][i] = min(minn[j][i - 1], minn[j + (1 << (i - 1))][i - 1]);
  }
  memset(ans, 0x3f, sizeof(ans));
  int T = 0;
  while (1 << (T + 1) <= n) T++;
  int maxn = -1;
  for (int i = 1; i + n - 1 <= len; i++) {
    int l = i, r = i + n;
    int t = T;
    while (l < r) {
      if (l + (1 << t) <= r) {
        ans[i] = min(ans[i], minn[l][t]);
        l += (1 << t);
      }
      t--;
    }
    maxn = max(maxn, ans[i] - 'a');
  }
  for (int i = 0; i < maxn; i++) {
    for (int j = 1; j <= a[i]; j++) putchar(i + 'a');
  }
  int cnt = 0, sum = 0;
  for (int i = 1; i + n - 1 <= len; i++) {
    if (i <= cnt) continue;
    if (ans[i] - 'a' == maxn) {
      int j = i + n - 1;
      while (s[j] != maxn + 'a') j--;
      cnt = j;
      sum++;
    }
  }
  for (int i = 1; i <= sum; i++) putchar(maxn + 'a');
  return 0;
}
