#include <bits/stdc++.h>
using namespace std;
int n, m;
int vis[100005];
pair<int, int> a[100005];
char s[100005];
bool check() {
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i])
      cnt = 0;
    else
      cnt++;
    if (cnt >= m) return 0;
  }
  return 1;
}
int calc(int c) {
  for (int i = 1; i <= n; i++)
    if (s[i] - 'a' == c) vis[i] = 0;
  int ret = 0, cnt = 0, cur = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] - 'a' == c) cur = i;
    if (vis[i])
      cnt = 0, cur = i;
    else
      cnt++;
    if (cnt >= m) ret++, cnt = i - cur, cur = 0;
  }
  return ret;
}
int main() {
  scanf("%d%s", &m, s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) a[i].first = s[i] - 'a', a[i].second = i;
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n;) {
    int j = i;
    while (a[i].first == a[j].first && j <= n) j++;
    for (int k = i; k < j; k++) vis[a[k].second] = 1;
    if (check()) {
      int p = calc(a[i].first);
      for (int k = 1; k < i; k++) printf("%c", (char)(a[k].first + 'a'));
      for (int k = 1; k <= p; k++) printf("%c", (char)(a[i].first + 'a'));
      return 0;
    }
    i = j;
  }
  return 0;
}
