#include <bits/stdc++.h>
double eps = 1e-9;
using namespace std;
char ch[100005], mud[200];
int m, cnt[100005], sum[30][100005];
bool used[100005];
bool check(int l, int r, int x) { return sum[x][r] - sum[x][l - 1] > 0; }
int bin_search(int l, int r, int x) {
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (check(mid + 1, r, x))
      l = mid + 1;
    else
      r = mid;
  }
  if (l > r) swap(l, r);
  if (check(r, r, x)) return r;
  if (check(l, l, x)) return l;
  return -1;
}
int main() {
  cin >> m;
  gets(mud);
  gets(ch);
  int n = strlen(ch);
  for (int i = n; i >= 1; i--) ch[i] = ch[i - 1];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) sum[j][i] = sum[j][i - 1];
    sum[ch[i] - 'a'][i]++;
  }
  for (int j = 0; j < 26; j++) {
    bool found = 0;
    for (int i = 1; i <= n - m + 1; i++) {
      if (!used[i]) {
        int idx = bin_search(i, i + m - 1, j);
        if (idx == -1) {
          found = 1;
          break;
        } else {
          cnt[j]++;
          for (int k = i; k <= idx; k++) used[k] = 1;
          i = idx;
        }
      }
    }
    if (found) {
      cnt[j] = sum[j][n];
      for (int i = 1; i <= n - m + 1; i++) {
        if (sum[j][i + m - 1] - sum[j][i - 1] > 0) used[i] = 1;
      }
    } else
      break;
  }
  for (int j = 0; j < 26; j++) {
    for (int i = 1; i <= cnt[j]; i++) printf("%c", (char)(j + (int)'a'));
  }
  puts("");
}
