#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int mod = 1000000007;
int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int m;
  string s;
  cin >> m >> s;
  vector<int> letters(26, 0);
  for (char c : s) {
    letters[c - 'a']++;
  }
  char mx = -1;
  int mxi = 0;
  int i = 0;
  while (i + m <= s.size()) {
    int j = i;
    int mn = -1;
    int mnj = -1;
    while (j < i + m) {
      if (s[j] < mx) {
        i = j;
        mnj = -1;
        mn = -1;
        break;
      }
      if (mn == -1 || s[j] <= mn) {
        mn = s[j];
        mnj = j;
      }
      j++;
    }
    if (mnj != -1) {
      if (mx < mn) {
        mx = mn;
        mxi = 1;
      } else if (mx == mn)
        mxi++;
      i = mnj;
    }
    i++;
  }
  char c = 'a';
  while (c < mx) {
    for (int i = 0; i < letters[c - 'a']; ++i) cout << c;
    c++;
  }
  for (int i = 0; i < mxi; ++i) cout << mx;
  return 0;
}
