#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  ;
  long long i, j, k, l, r, m, n, o, t;
  {
    char str[100001];
    bool mark[100000] = {0};
    long long alpha[26] = {0};
    cin >> m;
    cin >> str;
    l = strlen(str);
    for (i = 0; i < l; i++) alpha[str[i] - 'a']++;
    long long coun = 0;
    for (i = 0; i < 26; i++) {
      long long al = 'a' + i;
      bool flag = 1;
      for (j = 0; j <= l - m; j++) {
        bool fla = 0;
        for (k = j; k <= j + m - 1; k++) {
          if (mark[k] == 1 || str[k] == al) {
            fla = 1;
            break;
          }
        }
        if (fla == 0) {
          flag = 0;
          break;
        } else {
          j = k;
        }
      }
      if (flag) {
        for (j = 0; j <= l - m; j++) {
          bool flag = 1;
          for (k = j + m - 1; k >= j; k--) {
            if (mark[k] == 1) {
              flag = 0;
              j = k;
              break;
            }
          }
          if (flag) {
            for (k = j + m - 1; k >= j; k--) {
              if (str[k] == al) {
                coun++;
                j = k;
                break;
              }
            }
          }
        }
        break;
      } else {
        for (j = 0; j < l; j++)
          if (str[j] == al) mark[j] = 1;
      }
    }
    for (j = 0; j < i; j++) {
      for (k = 0; k < alpha[j]; k++) {
        cout << (char)('a' + j);
      }
    }
    for (k = 0; k < coun; k++) cout << (char)('a' + i);
    cout << endl;
  }
}
