#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 5000 + 7;
const long long MOD = 1e9 + 7;
char s[100010];
int ans;
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 0; i < 26; i++) {
    int cnt = 0;
    int flag = 0;
    for (int j = 0; j < len; j++) {
      if (s[j] - 'a' <= i) {
        cnt = 0;
      } else
        cnt++;
      if (cnt == n) break;
      if (j == len - 1) flag = 1;
    }
    if (flag == 1) {
      ans = i;
      break;
    }
  }
  int mp[40] = {0};
  int outt = 0;
  int c = 0;
  int max1 = 0;
  for (int i = 0; i < len; i++) {
    mp[s[i] - 'a']++;
    if (s[i] - 'a' < ans) {
      c = 0;
    } else {
      c++;
      if (s[i] - 'a' == ans) max1 = i;
      if (c == n) {
        c = i - max1;
        outt++;
      }
    }
  }
  for (int i = 0; i < ans; i++) {
    for (int j = 1; j <= mp[i]; j++) {
      printf("%c", i + 'a');
    }
  }
  for (int i = 1; i <= outt; i++) {
    printf("%c", ans + 'a');
  }
}
