#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int N = 100005;
const int M = 26;
const int inf = 1000000007;
const int mod = 20160519;
char s[N];
int m, v[M];
bool check(int k) {
  int i, p;
  for (i = 0; s[i] != '\0' && s[i] - 'a' > k; i++)
    ;
  if (s[i] == '\0' || i >= m) return false;
  for (p = i + m; s[i] != '\0'; i++) {
    if (s[i] - 'a' <= k) p = i + m;
    if (i >= p) break;
  }
  if (s[i] == '\0') return true;
  return false;
}
int main() {
  int i, k, p, c = 0, pos;
  scanf("%d", &m);
  scanf("%s", s);
  for (i = 0; s[i] != '\0'; i++) v[s[i] - 'a']++;
  for (i = 0; i < 26; i++) {
    if (!v[i]) continue;
    if (check(i)) break;
    while (v[i]--) printf("%c", i + 'a');
  }
  k = i;
  for (i = 0; s[i] != '\0' && s[i] - 'a' >= k; i++)
    if (s[i] - 'a' == k && i < m) pos = i;
  if (s[i] == '\0' || i >= m)
    i = pos, c++, p = pos + m;
  else
    p = i + m;
  for (; s[i] != '\0'; i++) {
    if (s[i] - 'a' < k) p = i + m;
    if (s[i] - 'a' == k) pos = i;
    if (i >= p) i = pos, c++, p = pos + m;
  }
  while (c--) printf("%c", k + 'a');
  puts("");
  return 0;
}
