// #define DEBUG
//#define USEPB_DS
#define USETR1
#define CPPELEVEN
#define GPP

/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
//#pragma comment(linker, "/STACK:1024000000,1024000000")

#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <list>
#include <iomanip>
#include <math.h>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <sstream>
#include <tuple>

using namespace std;

#ifndef CPPELEVEN
#ifdef USETR1
#include <tr1/unordered_map>
#include <tr1/unordered_set>
using namespace tr1;
#endif
#else
#include <unordered_map>
#include <unordered_set>
#endif

#ifdef USEPB_DS
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
// binomial_heap_tag, rc_binomial_heap_tag, thin_heap_tag, binary_heap_tag
typedef __gnu_pbds::priority_queue<int, greater<int>, pairing_heap_tag> pq_type;
// splay_tree_tag, ov_tree_tag
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> tree_type;
#endif

#define mpr make_pair
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <double, double> pdd;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <double> vd;
typedef vector <string> vs;
typedef map <string, int> mpsi;
typedef map <double, int> mpdi;
typedef map <int, int> mpii;

const double pi = acos(0.0) * 2.0;
const long double eps = 1e-10;
const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, -1}};

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}

#ifndef CPPELEVEN
template <class T> inline T max1(T a, T b) { return b < a ? a : b; }
template <class T> inline T max1(T a, T b, T c) { return max1(max1(a, b), c); }
template <class T> inline T max1(T a, T b, T c, T d) { return max1(max1(a, b, c), d); }
template <class T> inline T max1(T a, T b, T c, T d, T e) { return max1(max1(a, b, c, d), e); }
template <class T> inline T min1(T a, T b) { return a < b ? a : b; }
template <class T> inline T min1(T a, T b, T c) { return min1(min1(a, b), c); }
template <class T> inline T min1(T a, T b, T c, T d) { return min1(min1(a, b, c), d); }
template <class T> inline T min1(T a, T b, T c, T d, T e) { return min1(min1(a, b, c, d), e); }
#else
template <typename t, typename t1>
t min1(t a, t1 b) { return a < b ? a : b; }
template <typename t, typename... arg>
t min1(t a, arg... arr) { return min1(a, min1(arr...)); }
template <typename t, typename t1>
t max1(t a, t1 b) { return a > b ? a : b; }
template <typename t, typename... arg>
t max1(t a, arg... arr) { return max1(a, max1(arr...)); }
#endif

inline int jud(double a, double b){
	if(abs(a) < eps && abs(b) < eps) return 0;
	else if(abs1(a - b) / max(abs1(a), abs1(b)) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
template <typename t> inline int jud(t a, t b){
	if(a < b) return -1;
	if(a == b) return 0;
	return 1;
}

// f_lb == 1代表返回相同的一串的左边界，f_small == 1代表返回如果没有寻找的值返回小的数
template <typename it, typename t1>
inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1){
	if(na == 0) return 0;
	int be = 0, en = na - 1;
	if(*a <= *(a + na - 1)){
		if(f_lb == 0) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != 1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != -1) en = mid;
			else be = mid + 1;
		}
		if(f_small && jud(*(a + be), val) == 1) be--;
		if(!f_small && jud(*(a + be), val) == -1) be++;
	} else {
		if(f_lb) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != -1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != 1) en = mid;
			else be = mid + 1;
		}
		if(!f_small && jud(*(a + be), val) == -1) be--;
		if(f_small && jud(*(a + be), val) == 1) be++;
	}
	return be;
}

template <class T> inline T lowb(T num) {return num & (-num); }
#ifdef GPP
inline int bitnum(ui nValue) { return __builtin_popcount(nValue); }
inline int bitnum(int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(ull nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitnum(ll nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitmaxl(ui a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(int a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(ull a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
inline int bitmaxl(ll a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
#else
#endif

long long pow(long long n, long long m, long long mod = 0){
	if(m < 0) return 0;
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

#define  MOD 1000000007
template <class t1, class t2>
inline void add(t1 &a, t2 b, int mod = -1) {
	if(mod == -1) mod = MOD;
	a += b;
	while(a >= mod) a -= mod;
	while(a < 0) a += mod;
}
template <class t>
void output1(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		cerr << arr[i] << ' ';
	cerr << endl;
}
template <class t>
void output2(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		output1(arr[i]);
}

//....................密..........封..........线..........下..........禁..........止..........hack...............................................

const int maxn = 200100;
char str[maxn];
int l;
int m;
int nxt[maxn];

int main() {

//............................不要再忘了检查maxn大小了！！！！BSBandme你个SB！！！！...................................................

	ios_base::sync_with_stdio(0);
	#ifdef DEBUG //......................................................................................................
	freopen("input.txt", "r", stdin);
	int __size__ = 256 << 20; // 256MB
	char *__p__ = (char*)malloc(__size__) + __size__;
	__asm__("movl %0, %%esp\n" :: "r"(__p__));
	#endif //...........................................................................................................

	scanf("%d%s", &m, str);
	l = strlen(str);

	int lastc = -1;
	for(int i = 0; i < 26; i++) {
		int last = -1;
		bool flag = 1;
		for(int j = 0; j < l; j++) {
			if(j > last + m) {
				flag = 0;
				break;
			}
			if(str[j] - 'a' <= i)
				last = j;
		}
		if(flag == 0 || last < l - m) continue;
		lastc = i;
		break;
	}

	memset(nxt, -1, sizeof(nxt));
	int stat[30];
	memset(stat, 0, sizeof(stat));
	for(int j = l, rl = l - 1; j >= 0; j = nxt[j] ) {
		if(j != l)
			stat[str[j] - 'a']++;
		int rnxt = -1;
		rl = j - 1;
		while(rl >= 0 && j - rl <= m) {
			if(str[rl] - 'a' < lastc) {
				rnxt = rl;
				break;
			}
			if(str[rl] - 'a' == lastc)
				rnxt = rl;
			rl--;
		}
		if(rl == -1 && j != l) {
			nxt[j] = -1;
			break;
		}
		nxt[j] = rnxt;
	}
	for(int i = 0; i < 26; i++)
		for(int j = 0; j < stat[i]; j++)
			printf("%c", char(i + 'a'));
	puts("");

    return 0;
}


// #define DEBUG
//#define USEPB_DS
#define USETR1
#define CPPELEVEN
#define GPP

/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
//#pragma comment(linker, "/STACK:1024000000,1024000000")

#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <list>
#include <iomanip>
#include <math.h>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <sstream>
#include <tuple>

using namespace std;

#ifndef CPPELEVEN
#ifdef USETR1
#include <tr1/unordered_map>
#include <tr1/unordered_set>
using namespace tr1;
#endif
#else
#include <unordered_map>
#include <unordered_set>
#endif

#ifdef USEPB_DS
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
// binomial_heap_tag, rc_binomial_heap_tag, thin_heap_tag, binary_heap_tag
typedef __gnu_pbds::priority_queue<int, greater<int>, pairing_heap_tag> pq_type;
// splay_tree_tag, ov_tree_tag
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> tree_type;
#endif

#define mpr make_pair
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <double, double> pdd;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <double> vd;
typedef vector <string> vs;
typedef map <string, int> mpsi;
typedef map <double, int> mpdi;
typedef map <int, int> mpii;

const double pi = acos(0.0) * 2.0;
const long double eps = 1e-10;
const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, -1}};

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}

#ifndef CPPELEVEN
template <class T> inline T max1(T a, T b) { return b < a ? a : b; }
template <class T> inline T max1(T a, T b, T c) { return max1(max1(a, b), c); }
template <class T> inline T max1(T a, T b, T c, T d) { return max1(max1(a, b, c), d); }
template <class T> inline T max1(T a, T b, T c, T d, T e) { return max1(max1(a, b, c, d), e); }
template <class T> inline T min1(T a, T b) { return a < b ? a : b; }
template <class T> inline T min1(T a, T b, T c) { return min1(min1(a, b), c); }
template <class T> inline T min1(T a, T b, T c, T d) { return min1(min1(a, b, c), d); }
template <class T> inline T min1(T a, T b, T c, T d, T e) { return min1(min1(a, b, c, d), e); }
#else
template <typename t, typename t1>
t min1(t a, t1 b) { return a < b ? a : b; }
template <typename t, typename... arg>
t min1(t a, arg... arr) { return min1(a, min1(arr...)); }
template <typename t, typename t1>
t max1(t a, t1 b) { return a > b ? a : b; }
template <typename t, typename... arg>
t max1(t a, arg... arr) { return max1(a, max1(arr...)); }
#endif

inline int jud(double a, double b){
	if(abs(a) < eps && abs(b) < eps) return 0;
	else if(abs1(a - b) / max(abs1(a), abs1(b)) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
template <typename t> inline int jud(t a, t b){
	if(a < b) return -1;
	if(a == b) return 0;
	return 1;
}

// f_lb == 1代表返回相同的一串的左边界，f_small == 1代表返回如果没有寻找的值返回小的数
template <typename it, typename t1>
inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1){
	if(na == 0) return 0;
	int be = 0, en = na - 1;
	if(*a <= *(a + na - 1)){
		if(f_lb == 0) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != 1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != -1) en = mid;
			else be = mid + 1;
		}
		if(f_small && jud(*(a + be), val) == 1) be--;
		if(!f_small && jud(*(a + be), val) == -1) be++;
	} else {
		if(f_lb) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != -1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != 1) en = mid;
			else be = mid + 1;
		}
		if(!f_small && jud(*(a + be), val) == -1) be--;
		if(f_small && jud(*(a + be), val) == 1) be++;
	}
	return be;
}

template <class T> inline T lowb(T num) {return num & (-num); }
#ifdef GPP
inline int bitnum(ui nValue) { return __builtin_popcount(nValue); }
inline int bitnum(int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(ull nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitnum(ll nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitmaxl(ui a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(int a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(ull a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
inline int bitmaxl(ll a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
#else
#endif

long long pow(long long n, long long m, long long mod = 0){
	if(m < 0) return 0;
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

#define  MOD 1000000007
template <class t1, class t2>
inline void add(t1 &a, t2 b, int mod = -1) {
	if(mod == -1) mod = MOD;
	a += b;
	while(a >= mod) a -= mod;
	while(a < 0) a += mod;
}
template <class t>
void output1(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		cerr << arr[i] << ' ';
	cerr << endl;
}
template <class t>
void output2(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		output1(arr[i]);
}

//....................密..........封..........线..........下..........禁..........止..........hack...............................................

const int maxn = 100100;
char str[maxn];
int l;
int m;
int dp[100100][30];

int main() {

//............................不要再忘了检查maxn大小了！！！！BSBandme你个SB！！！！...................................................

	ios_base::sync_with_stdio(0);
	#ifdef DEBUG //......................................................................................................
	freopen("input.txt", "r", stdin);
	int __size__ = 256 << 20; // 256MB
	char *__p__ = (char*)malloc(__size__) + __size__;
	__asm__("movl %0, %%esp\n" :: "r"(__p__));
	#endif //...........................................................................................................

	scanf("%d%s", &m, str);
	l = strlen(str);

	memset(dp, -1, sizeof(dp));
	int nxt[30];
	memset(nxt, 0x3f, sizeof(nxt));
	for(int i = l - 1, ri = l - 1; i >= 0; i--) {
		while(ri >= 0 && i - ri <= m) {
			nxt[str[ri] - 'a'] = ri;
			ri--;
		}
		for(int j = 0; j < 26; j++) if(nxt[j] < i) {
			dp[i][29] = nxt[j];
			break;
		}
		if(str[dp[i][29]] > str[i] && i - m < 0)
			dp[i][29] = -1;
	}
	for(int i = 0; i < l; i++) {
		for(int j = 0; j < 26; j++) dp[i][j] = 0;
		dp[i][str[i] - 'a']++;
		int no = dp[i][29];
		if(no != -1)
			for(int j = 0; j < 26; j++) dp[i][j] += dp[no][j];
		for(int j = 0; j < 26; j++) if(dp[i][j])
			dp[i][28] = j;
	}
	int ansno = l - 1;
	for(int i = l - 1; i >= l - m; i--) {
		bool flag = 0;
		for(int j = 0; j < min(dp[i][28], dp[ansno][28]); j++) if(dp[i][j] != dp[ansno][j]) {
			flag = 1;
			if(dp[ansno][j] < dp[i][j])
				ansno = i;
		}
		if(!flag) {
			if(dp[i][28] == dp[ansno][28] && dp[i][dp[i][28]] < dp[ansno][dp[i][28]])
				ansno = i;
			if(dp[i][28] < dp[ansno][28])
				ansno = i;
		}
	}
	for(int i = 0; i < 26; i++)
		for(int j = 0; j < dp[ansno][i]; j++)
			printf("%c", char(i + 'a'));
	puts("");

    return 0;
}


// #define DEBUG
//#define USEPB_DS
#define USETR1
#define CPPELEVEN
#define GPP

/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
//#pragma comment(linker, "/STACK:1024000000,1024000000")

#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <list>
#include <iomanip>
#include <math.h>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <sstream>
#include <tuple>

using namespace std;

#ifndef CPPELEVEN
#ifdef USETR1
#include <tr1/unordered_map>
#include <tr1/unordered_set>
using namespace tr1;
#endif
#else
#include <unordered_map>
#include <unordered_set>
#endif

#ifdef USEPB_DS
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
// binomial_heap_tag, rc_binomial_heap_tag, thin_heap_tag, binary_heap_tag
typedef __gnu_pbds::priority_queue<int, greater<int>, pairing_heap_tag> pq_type;
// splay_tree_tag, ov_tree_tag
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> tree_type;
#endif

#define mpr make_pair
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <double, double> pdd;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <double> vd;
typedef vector <string> vs;
typedef map <string, int> mpsi;
typedef map <double, int> mpdi;
typedef map <int, int> mpii;

const double pi = acos(0.0) * 2.0;
const long double eps = 1e-10;
const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, -1}};

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}

#ifndef CPPELEVEN
template <class T> inline T max1(T a, T b) { return b < a ? a : b; }
template <class T> inline T max1(T a, T b, T c) { return max1(max1(a, b), c); }
template <class T> inline T max1(T a, T b, T c, T d) { return max1(max1(a, b, c), d); }
template <class T> inline T max1(T a, T b, T c, T d, T e) { return max1(max1(a, b, c, d), e); }
template <class T> inline T min1(T a, T b) { return a < b ? a : b; }
template <class T> inline T min1(T a, T b, T c) { return min1(min1(a, b), c); }
template <class T> inline T min1(T a, T b, T c, T d) { return min1(min1(a, b, c), d); }
template <class T> inline T min1(T a, T b, T c, T d, T e) { return min1(min1(a, b, c, d), e); }
#else
template <typename t, typename t1>
t min1(t a, t1 b) { return a < b ? a : b; }
template <typename t, typename... arg>
t min1(t a, arg... arr) { return min1(a, min1(arr...)); }
template <typename t, typename t1>
t max1(t a, t1 b) { return a > b ? a : b; }
template <typename t, typename... arg>
t max1(t a, arg... arr) { return max1(a, max1(arr...)); }
#endif

inline int jud(double a, double b){
	if(abs(a) < eps && abs(b) < eps) return 0;
	else if(abs1(a - b) / max(abs1(a), abs1(b)) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
template <typename t> inline int jud(t a, t b){
	if(a < b) return -1;
	if(a == b) return 0;
	return 1;
}

// f_lb == 1代表返回相同的一串的左边界，f_small == 1代表返回如果没有寻找的值返回小的数
template <typename it, typename t1>
inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1){
	if(na == 0) return 0;
	int be = 0, en = na - 1;
	if(*a <= *(a + na - 1)){
		if(f_lb == 0) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != 1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != -1) en = mid;
			else be = mid + 1;
		}
		if(f_small && jud(*(a + be), val) == 1) be--;
		if(!f_small && jud(*(a + be), val) == -1) be++;
	} else {
		if(f_lb) while(be < en){
			int mid = (be + en + 1) / 2;
			if(jud(*(a + mid), val) != -1) be = mid;
			else en = mid - 1;
		}else while(be < en){
			int mid = (be + en) / 2;
			if(jud(*(a + mid), val) != 1) en = mid;
			else be = mid + 1;
		}
		if(!f_small && jud(*(a + be), val) == -1) be--;
		if(f_small && jud(*(a + be), val) == 1) be++;
	}
	return be;
}

template <class T> inline T lowb(T num) {return num & (-num); }
#ifdef GPP
inline int bitnum(ui nValue) { return __builtin_popcount(nValue); }
inline int bitnum(int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(ull nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitnum(ll nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); }
inline int bitmaxl(ui a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(int a) { if(a == 0) return 0; return 32 - __builtin_clz(a); }
inline int bitmaxl(ull a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
inline int bitmaxl(ll a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); }
#else
#endif

long long pow(long long n, long long m, long long mod = 0){
	if(m < 0) return 0;
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

#define  MOD 1000000007
template <class t1, class t2>
inline void add(t1 &a, t2 b, int mod = -1) {
	if(mod == -1) mod = MOD;
	a += b;
	while(a >= mod) a -= mod;
	while(a < 0) a += mod;
}
template <class t>
void output1(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		cerr << arr[i] << ' ';
	cerr << endl;
}
template <class t>
void output2(t arr) {
	for(int i = 0; i < (int)arr.size(); i++)
		output1(arr[i]);
}

//....................密..........封..........线..........下..........禁..........止..........hack...............................................

const int maxn = 100100;
char str[maxn];
int l;
int m;
int dp[100100][30];

int main() {

//............................不要再忘了检查maxn大小了！！！！BSBandme你个SB！！！！...................................................

	ios_base::sync_with_stdio(0);
	#ifdef DEBUG //......................................................................................................
	freopen("input.txt", "r", stdin);
	int __size__ = 256 << 20; // 256MB
	char *__p__ = (char*)malloc(__size__) + __size__;
	__asm__("movl %0, %%esp\n" :: "r"(__p__));
	#endif //...........................................................................................................

	scanf("%d%s", &m, str);
	l = strlen(str);

	memset(dp, -1, sizeof(dp));
	int nxt[30];
	memset(nxt, 0x3f, sizeof(nxt));
	for(int i = l - 1, ri = l - 1; i >= 0; i--) {
		while(ri >= 0 && i - ri <= m) {
			nxt[str[ri] - 'a'] = ri;
			ri--;
		}
		for(int j = 0; j < 26; j++) if(nxt[j] < i) {
			dp[i][29] = nxt[j];
			break;
		}
		if(str[dp[i][29]] >= str[i] && i - m < 0)
			dp[i][29] = -1;
	}
	for(int i = 0; i < l; i++) {
		for(int j = 0; j < 26; j++) dp[i][j] = 0;
		dp[i][str[i] - 'a']++;
		int no = dp[i][29];
		if(no != -1)
			for(int j = 0; j < 26; j++) dp[i][j] += dp[no][j];
		for(int j = 0; j < 26; j++) if(dp[i][j])
			dp[i][28] = j;
	}
	int ansno = l - 1;
	for(int i = l - 1; i >= l - m; i--) {
		bool flag = 0;
		for(int j = 0; j < min(dp[i][28], dp[ansno][28]); j++) if(dp[i][j] != dp[ansno][j]) {
			flag = 1;
			if(dp[ansno][j] < dp[i][j])
				ansno = i;
		}
		if(!flag) {
			if(dp[i][28] == dp[ansno][28] && dp[i][dp[i][28]] < dp[ansno][dp[i][28]])
				ansno = i;
			if(dp[i][28] < dp[ansno][28])
				ansno = i;
		}
	}
	for(int i = 0; i < 26; i++)
		for(int j = 0; j < dp[ansno][i]; j++)
			printf("%c", char(i + 'a'));
	puts("");

    return 0;
}


#include<iostream>
#include<string>
#include<ctime>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
//double ±1.7×10^-308 ~ ±1.7×10^308
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define mod 1000000000000000007
#define eps 1e-9
#define con continue
#define bk break
#define LL long long
#define db double
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
#define se second
#define fi first
#define sz size()
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef pair<int,int> pii;typedef pair<db,db> pdd;typedef pair<LL,LL> pll;
char A[100005]={};
int main()
{
	int a;
	while(cin>>a){
		int tmp[26]={};
	cin>>A;
	map<int,int>cnt;
	map<int,int>now;
	int flag=0;
	vector<int>ans;
	for(int i=0;A[i];i++){
	now[A[i]-'a']=1;
	if(i+1==a){
	flag=1;
	}
	if(flag){
		for(auto j=now.begin();j!=now.end();j++){
			if(tmp[j->first])
				bk;
			if(now[j->first]){
				ans.push_back(j->first);
				tmp[j->first]=1;
		bk;
			}
		}
		tmp[A[i-(a-1)]-'a']=0;
		now[A[i-(a-1)]-'a']--;
	}
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<ans.sz;i++)
		cout<<char(ans[i]+'a');
	cout<<endl;
	}
	return 0;
}


#include<iostream>
#include<string>
#include<ctime>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
//double ±1.7×10^-308 ~ ±1.7×10^308
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define mod 1000000000000000007
#define eps 1e-9
#define con continue
#define bk break
#define LL long long
#define db double
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
#define se second
#define fi first
#define sz size()
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef pair<int,int> pii;typedef pair<db,db> pdd;typedef pair<LL,LL> pll;
char A[200005]={};
int vis[200005]={};
int main()
{
	int a;
	while(cin>>a){
	cin>>A;
	int n=strlen(A);
	char maxr=0;
	for(int i=0;i<=n-a;i++){
	char now=A[i];
	int nex=i;
	for(int j=i;j<a+i;j++){
		if(A[j]<now){
		nex=j;
		now=A[j];
		}
	}
	maxr=max(maxr,now);
	i=nex;
	vis[i]=1;
	}
	vector<char>ans;
	for(int i=0;A[i];i++){
	if(vis[i])
		ans.push_back(A[i]);
	}
	for(int i=0;A[i];i++){
		if(!vis[i]&&A[i]<maxr){
			ans.push_back(A[i]);
		}
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<ans.sz;i++){
	cout<<ans[i];
	}
	cout<<endl;
	}
	return 0;
}


#include<iostream>
#include<string>
#include<ctime>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
//double ±1.7×10^-308 ~ ±1.7×10^308
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define mod 1000000000000000007
#define eps 1e-9
#define con continue
#define bk break
#define LL long long
#define db double
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
#define se second
#define fi first
#define sz size()
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef pair<int,int> pii;typedef pair<db,db> pdd;typedef pair<LL,LL> pll;
char A[200005]={};
int vis[200005]={};
int main()
{
	int a;
	while(cin>>a){
	cin>>A;
	int n=strlen(A);
	char maxr=0;
	for(int i=0;i<n-a;i++){
	char now=A[i];
	int nex=i;
	for(int j=i;j<a+i;j++){
		if(A[j]<=now){
		nex=j;
		now=A[j];
		}
	}
	maxr=max(maxr,now);
	i=nex;
	vis[i]=1;
	}
	vector<char>ans;
	for(int i=0;A[i];i++){
	if(vis[i])
		ans.push_back(A[i]);
	}
	for(int i=0;A[i];i++){
		if(!vis[i]&&A[i]<maxr){
			ans.push_back(A[i]);
		}
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<ans.sz;i++){
	cout<<ans[i];
	}
	cout<<endl;
	}
	return 0;
}


#include<iostream>
#include<string>
#include<ctime>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
//double ±1.7×10^-308 ~ ±1.7×10^308
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define mod 1000000000000000007
#define eps 1e-9
#define con continue
#define bk break
#define LL long long
#define db double
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
#define se second
#define fi first
#define sz size()
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef pair<int,int> pii;typedef pair<db,db> pdd;typedef pair<LL,LL> pll;
char A[200005]={};
int vis[200005]={};
int main()
{
	int a;
	while(cin>>a){
	cin>>A;
	int n=strlen(A);
	char maxr=0;
	for(int i=0;i<n-a;i++){
	char now=A[i];
	int nex=i;
	for(int j=i;j<a+i;j++){
		if(A[j]<now){
		nex=j;
		now=A[j];
		}
	}
	maxr=max(maxr,now);
	i=nex;
	vis[i]=1;
	}
	vector<char>ans;
	for(int i=0;A[i];i++){
	if(vis[i])
		ans.push_back(A[i]);
	}
	for(int i=0;A[i];i++){
		if(!vis[i]&&A[i]<maxr){
			ans.push_back(A[i]);
		}
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<ans.sz;i++){
	cout<<ans[i];
	}
	cout<<endl;
	}
	return 0;
}


#include<iostream>
#include<string>
#include<ctime>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
//double ±1.7×10^-308 ~ ±1.7×10^308
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define mod 1000000000000000007
#define eps 1e-9
#define con continue
#define bk break
#define LL long long
#define db double
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
#define se second
#define fi first
#define sz size()
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef pair<int,int> pii;typedef pair<db,db> pdd;typedef pair<LL,LL> pll;
char A[200005]={};
int vis[200005]={};
int main()
{
	int a;
	while(cin>>a){
	cin>>A;
	int n=strlen(A);
	char maxr=0;
	for(int i=0;i<=n-a;i++){
	char now=A[i];
	int nex=i;
	for(int j=i;j<a+i;j++){
		if(A[j]<=now){
		nex=j;
		now=A[j];
		}
	}
	maxr=max(maxr,now);
	i=nex;
	vis[i]=1;
	}
	vector<char>ans;
	for(int i=0;A[i];i++){
	if(vis[i])
		ans.push_back(A[i]);
	}
	for(int i=0;A[i];i++){
		if(!vis[i]&&A[i]<maxr){
			ans.push_back(A[i]);
		}
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<ans.sz;i++){
	cout<<ans[i];
	}
	cout<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = 1e5 + 20;
int seg[4 * N];
string str;
vector<int> ans;

void build(int st, int en, int idx){
    if(st == en){
        seg[idx] = st;
        return;
    }
    int mid = (st + en) / 2;
    build(st, mid, idx * 2);
    build(mid + 1, en, idx * 2 + 1);
    if(str[seg[idx * 2]] < str[seg[idx * 2 + 1]])
        seg[idx] = seg[idx * 2];
    else
        seg[idx] = seg[idx * 2 + 1];
}
int Get(int st, int en, int idx, int l, int r){
    if(st >= l && en <= r)
        return seg[idx];
    if(r < st || l > en)
        return -1;

    int mid = (st + en) / 2;
    int L = Get(st, mid, idx * 2, l, r);
    int R = Get(mid + 1, en, idx * 2 + 1, l, r);
    if(L == -1)
        return R;
    if(R == -1)
        return L;
    if(str[L] < str[R])
        return L;
    else
        return R;
}
int main(){
//    string arr[2];
//    arr[0] = "abb";
//    arr[1] = "ab";
//    sort(arr, arr + 2);
//    cout << arr[0] << '\n' << arr[1] << '\n';
//    return 0;
    int m;
    string ero;
    cin >> m >> str;
    build(0, str.size(), 1);
    int used = -m - 2, mx = -10;
    for(int i = m - 1; i < (int)str.size(); i++){
        int ex = Get(0, str.size(), 1, i - m + 1, i);
        if(i - used >= m)
            ans.pb(ex), used = ex, mx = max(mx, str[ex] - 'a');
    }
//    cout << mx << '\n';
//    cout << "================\n";
//    for(int i = 0; i < (int)ans.size(); i++)
//        cout << ans[i] << ' ';
//    cout << "================\n";
    for(int i = 0; i < (int)ans.size(); i++)
        if(str[ans[i]] - 'a' == mx)
            ero += str[ans[i]];
    for(int i = 0; i < (int)str.size(); i++)
        if(str[i] - 'a' < mx)
            ero += str[i];

//    3
//    abbbbcb

//    for(int i = 0; i < (int)ans.size(); i++)
//        ero += str[ans[i]];
////    return 0;
    sort(ero.begin(), ero.end());
    cout << ero << '\n';

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m;
    string str;
    cin >> m >> str;
    for(char c = 'a'; c <= 'z'; c++){
        int cnt = 0, last = -1, used = -1, can = 1;

        for(int i = 0; i < (int)str.size(); i++){
            if(str[i] < c)
                used = i;
            if(str[i] == c)
                last = i;
            if(i - used >= m){
                if(i - last >= m)
                    can = 0;
                else
                    used = last, cnt++;
            }
        }
        if(can){
            string ans;
            for(int i = 0; i < (int)str.size(); i++)
                if(str[i] < c)
                    ans += str[i];
            while(cnt--)
                ans += c;
            sort(ans.begin(), ans.end());
            return cout << ans << '\n', 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m;
    string str;
    cin >> m >> str;
    for(char c = 'a'; c <= 'z'; c++){
        int cnt = 0, last = -m - 2, used = -m - 2, can = 1;
        for(int i = m - 1; i >= 0; i--)
            if(str[i] < c){
                    used = i;
                    break;
            }
        for(int i = m - 1; i >= 0; i--)
            if(str[i] == c){
                    last = i;
                    break;
            }
        if(used == -m - 2 && last == -m - 2)
            can = 0;
        if(used == -m - 2)
            cnt++, used = last;
        for(int i = m; i < (int)str.size(); i++){
            if(str[i] < c)
                used = i;
            if(str[i] == c)
                last = i;
            if(i - used >= m){
                if(i - last >= m)
                    can = 0;
                else
                    used = last, cnt++;
            }
        }
        if(can){
            string ans;
            for(int i = 0; i < (int)str.size(); i++)
                if(str[i] < c)
                    ans += str[i];
            while(cnt--)
                ans += c;
            sort(ans.begin(), ans.end());
            return cout << ans << '\n', 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m;
    string str;
    cin >> m >> str;
    for(char c = 'a'; c <= 'z'; c++){
        int cnt = 0, last = -m - 2, used = -m - 2, can = 1;
        for(int i = m - 1; i >= 0; i--)
            if(str[i] < c){
                    used = i;
                    break;
            }
        for(int i = m - 1; i >= 0; i--)
            if(str[i] == c){
                    last = i;
                    break;
            }
        if(used == -m - 2)
            cnt++, last = used;
        for(int i = m; i < (int)str.size(); i++){
            if(str[i] < c)
                used = i;
            if(str[i] == c)
                last = i;
            if(i - used >= m){
                if(i - last >= m)
                    can = 0;
                else
                    used = last, cnt++;
            }
        }
        if(can){
            string ans;
            for(int i = 0; i < (int)str.size(); i++)
                if(str[i] < c)
                    ans += str[i];
            while(cnt--)
                ans += c;
            sort(ans.begin(), ans.end());
            return cout << ans << '\n', 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = 1e5 + 20;
int seg[4 * N];
string str;
vector<int> ans;

void build(int st, int en, int idx){
    if(st == en){
        seg[idx] = st;
        return;
    }
    int mid = (st + en) / 2;
    build(st, mid, idx * 2);
    build(mid + 1, en, idx * 2 + 1);
    if(str[seg[idx * 2]] < str[seg[idx * 2 + 1]])
        seg[idx] = seg[idx * 2];
    else
        seg[idx] = seg[idx * 2 + 1];
}
int Get(int st, int en, int idx, int l, int r){
    if(st >= l && en <= r)
        return seg[idx];
    if(r < st || l > en)
        return -1;

    int mid = (st + en) / 2;
    int L = Get(st, mid, idx * 2, l, r);
    int R = Get(mid + 1, en, idx * 2 + 1, l, r);
    if(L == -1)
        return R;
    if(R == -1)
        return L;
    if(str[L] < str[R])
        return L;
    else
        return R;
}
int main(){

    int m;
    string ero;
    cin >> m >> str;
    build(0, str.size(), 1);
    int used = -m - 2;
    for(int i = m - 1; i < (int)str.size(); i++){
        if(ans.size())
            used = ans.back();
        int ex = Get(0, str.size(), 1, i - m + 1, i);
        if(ex != used)
            ans.pb(ex);

    }
    for(int i = 0; i < (int)ans.size(); i++)
        ero += str[ans[i]];
    sort(ero.begin(), ero.end());
    cout << ero << '\n';

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m;
    string str;
    cin >> m >> str;
    for(char c = 'a'; c <= 'z'; c++){
        int cnt = 0, last = -m - 2, used = -m - 2, can = 1;
        for(int i = m - 1; i >= 0; i--)
            if(str[i] < c){
                    used = i;
                    break;
            }
        for(int i = m - 1; i >= 0; i--)
            if(str[i] == c){
                    last = i;
                    break;
            }
        if(used == -m - 2)
            cnt++, last = used;
        for(int i = m; i < (int)str.size(); i++){
            if(str[i] < c)
                used = i;
            if(str[i] == c)
                last = i;
            if(i - used >= m){
                if(i - last >= m)
                    can = 0;
                else
                    used = last, cnt++;
            }
        }
        if(can){
            string ans;
            for(int i = 0; i < (int)str.size(); i++)
                if(str[i] < c)
                    ans += str[i];
            while(cnt--)
                ans += c;
            return cout << ans << '\n', 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m;
    string str;
    cin >> m >> str;
    for(char c = 'a'; c <= 'z'; c++){
        int cnt = 0, last = -m - 2, used = -m - 2, can = 1;
        for(int i = m - 1; i >= 0; i--)
            if(str[i] < c){
                    used = i;
                    break;
            }
        for(int i = m - 1; i >= 0; i--)
            if(str[i] == c){
                    last = i;
                    break;
            }
        if(used == -m - 2)
            cnt++, used = last;
        for(int i = m; i < (int)str.size(); i++){
            if(str[i] < c)
                used = i;
            if(str[i] == c)
                last = i;
            if(i - used >= m){
                if(i - last >= m)
                    can = 0;
                else
                    used = last, cnt++;
            }
        }
        if(can){
            string ans;
            for(int i = 0; i < (int)str.size(); i++)
                if(str[i] < c)
                    ans += str[i];
            while(cnt--)
                ans += c;
            sort(ans.begin(), ans.end());
            return cout << ans << '\n', 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
int bit[100005],len;
char s[100005];
vector<int> dic[26];
vector<P> ans;
inline void modify(int pos,int add){
	for(;pos<=len;pos+=pos&-pos)
		bit[pos]+=add;
}
inline int query(int pos){
	int sum=0;
	for(;pos;pos-=pos&-pos)
		sum+=bit[pos];
	return sum;
}
inline int get_sum(int l,int r){
	return query(r)-query(l-1);
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int m;
	cin>>m>>(s+1);
	len=strlen(s+1);
	for(int i=1;i<=len;i++)
		dic[s[i]-'a'].push_back(i);
	bool ok=false;
	for(int i=0;i<26 && !ok;i++){
		int pos=0;
		if(!dic[i].size()) continue;
		for(int j=0;j<dic[i].size();j++){
			pos=dic[i][j];
			modify(pos,1);
			ans.push_back(P((char)(i+'a'),pos));
		}
		bool flag=true;
		for(int j=1;j<=len-m+1 && flag;j++){
			if(!get_sum(j,j+m-1))
				flag=false;
		}
		if(flag) ok=true;
	}
	sort(ans.begin(),ans.end());
	char last=ans[ans.size()-1].first;
	for(int i=ans.size()-1;i>=-1;i--){
		if(i==-1){
			ans.resize(0);
			break;
		}
		if(ans[i].first!=last){
			ans.resize(i+1);
			break;
		}else{
			modify(ans[i].second,-1);
		}
	}
	auto cur=dic[last-'a'].begin();

	for(int i=1;i<=len-m+1;i++)
		if(!get_sum(i,i+m-1)){
			while(cur!=dic[last-'a'].end() && *cur<=i+m-1)
				cur++;
			cur--;
			modify(*cur,1);
			ans.push_back(P(last,*cur));
		}
	for(int i=0;i<ans.size();i++)
		cout<<ans[i].first;
	cout<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
string s,ans;
P seg[400005];
bool vis[100005];
P cmp(P a,P b){
	if(a.first!=b.first)
		return a.first<b.first?a:b;
	return a.second>b.second?a:b;
}
void build(int l,int r,int idx){
	if(l==r){
		seg[idx]=P(s[l],l);
	}else{
		int mid=l+r>>1;
		build(l,mid,idx<<1);
		build(mid+1,r,idx<<1|1);
		seg[idx]=min(seg[idx<<1],seg[idx<<1|1]);
	}
}
P query(int l,int r,int ql,int qr,int idx){
	if(l==ql && r==qr)
		return seg[idx];
	int mid=l+r>>1;
	if(qr<=mid)
		return query(l,mid,ql,qr,idx<<1);
	else if(ql>mid)
		return query(mid+1,r,ql,qr,idx<<1|1);
	else
		return min(query(l,mid,ql,mid,idx<<1),query(mid+1,r,mid+1,qr,idx<<1|1));
}
int main(){
	int m;
	cin>>m>>s;
	build(0,s.size()-1,1);
	for(int i=0;i<=s.size()-m;i++){
		int pos=query(0,s.size()-1,i,i+m-1,1).second;
		if(vis[pos]) continue;
		ans+=s[pos];
		vis[pos]=true;
	}
	sort(ans.begin(),ans.end());
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
string s,ans;
P seg[400005];
P cmp(P a,P b){
	if(a.first!=b.first)
		return a.first<b.first?a:b;
	return a.second>b.second?a:b;
}
void build(int l,int r,int idx){
	if(l==r){
		seg[idx]=P(s[l],l);
	}else{
		int mid=l+r>>1;
		build(l,mid,idx<<1);
		build(mid+1,r,idx<<1|1);
		seg[idx]=min(seg[idx<<1],seg[idx<<1|1]);
	}
}
P query(int l,int r,int ql,int qr,int idx){
	if(l==ql && r==qr)
		return seg[idx];
	int mid=l+r>>1;
	if(qr<=mid)
		return query(l,mid,ql,qr,idx<<1);
	else if(ql>mid)
		return query(mid+1,r,ql,qr,idx<<1|1);
	else
		return min(query(l,mid,ql,mid,idx<<1),query(mid+1,r,mid+1,qr,idx<<1|1));
}
int main(){
	int m,pre=-1;
	cin>>m>>s;
	build(0,s.size()-1,1);
	for(int i=0;i<=s.size()-m;i++){
		int pos=min_element(s.begin()+i,s.begin()+i+m)-s.begin();
		if(pos==pre) continue;
		ans+=s[pos];
		pre=pos;
	}
	sort(ans.begin(),ans.end());
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
string s,ans;
P seg[400005];
bool vis[100005];
P cmp(P a,P b){
	if(a.first!=b.first)
		return a.first<b.first?a:b;
	return a.second>b.second?a:b;
}
void build(int l,int r,int idx){
	if(l==r){
		seg[idx]=P(s[l],l);
	}else{
		int mid=l+r>>1;
		build(l,mid,idx<<1);
		build(mid+1,r,idx<<1|1);
		seg[idx]=cmp(seg[idx<<1],seg[idx<<1|1]);
	}
}
P query(int l,int r,int ql,int qr,int idx){
	if(l==ql && r==qr)
		return seg[idx];
	int mid=l+r>>1;
	if(qr<=mid)
		return query(l,mid,ql,qr,idx<<1);
	else if(ql>mid)
		return query(mid+1,r,ql,qr,idx<<1|1);
	else
		return cmp(query(l,mid,ql,mid,idx<<1),query(mid+1,r,mid+1,qr,idx<<1|1));
}
int main(){
	int m;
	cin>>m>>s;
	build(0,s.size()-1,1);
	for(int i=0;i<=s.size()-m;i++){
		int pos=query(0,s.size()-1,i,i+m-1,1).second;
		if(vis[pos]) continue;
		ans+=s[pos];
		vis[pos]=true;
		if(pos+m-1<=s.size()-m)
			i=query(0,s.size()-1,pos,pos+m-1,1).second-1;
	}
	sort(ans.begin(),ans.end());
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
int bit[100005],len;
char s[100005];
vector<int> dic[26];
vector<P> ans;
inline void modify(int pos,int add){
	for(;pos<=len;pos+=pos&-pos)
		bit[pos]+=add;
}
inline int query(int pos){
	int sum=0;
	for(;pos;pos-=pos&-pos)
		sum+=bit[pos];
	return sum;
}
inline int get_sum(int l,int r){
	return query(r)-query(l-1);
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int m;
	cin>>m>>(s+1);
	len=strlen(s+1);
	for(int i=1;i<=len;i++)
		dic[s[i]-'a'].push_back(i);
	bool ok=false;
	for(int i=0;i<26 && !ok;i++){
		int pos=0;
		if(!dic[i].size()) continue;
		for(int j=0;j<dic[i].size();j++){
			pos=dic[i][j];
			modify(pos,1);
			ans.push_back(P((char)(i+'a'),pos));
		}
		bool flag=true;
		for(int j=1;j<=len-m+1 && flag;j++){
			if(!get_sum(j,j+m-1))
				flag=false;
		}
		if(flag) ok=true;
	}
	sort(ans.begin(),ans.end());
	char last=ans[ans.size()-1].first;
	for(int i=ans.size()-1;i>=-1;i--){
		if(i==-1){
			ans.resize(0);
			break;
		}
		if(ans[i].first!=last){
			ans.resize(i+1);
			break;
		}else{
			modify(ans[i].second,-1);
		}
	}
	auto cur=dic[last-'a'].begin();

	for(int i=1;i<=len-m+1;i++)
		if(!get_sum(i,i+m-1)){
			while(cur!=dic[last-'a'].end()){
				if(i<=*cur && *cur<=i+m-1){
					modify(*cur,1);
					ans.push_back(P(last,*cur));
					cur++;
					break;
				}
				cur++;
			}
		}
	for(int i=0;i<ans.size();i++)
		cout<<ans[i].first;
	cout<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
string s,ans;
P seg[400005];
bool vis[100005];
P cmp(P a,P b){
	if(a.first!=b.first)
		return a.first<b.first?a:b;
	return a.second>b.second?a:b;
}
void build(int l,int r,int idx){
	if(l==r){
		seg[idx]=P(s[l],l);
	}else{
		int mid=l+r>>1;
		build(l,mid,idx<<1);
		build(mid+1,r,idx<<1|1);
		seg[idx]=cmp(seg[idx<<1],seg[idx<<1|1]);
	}
}
P query(int l,int r,int ql,int qr,int idx){
	if(l==ql && r==qr)
		return seg[idx];
	int mid=l+r>>1;
	if(qr<=mid)
		return query(l,mid,ql,qr,idx<<1);
	else if(ql>mid)
		return query(mid+1,r,ql,qr,idx<<1|1);
	else
		return cmp(query(l,mid,ql,mid,idx<<1),query(mid+1,r,mid+1,qr,idx<<1|1));
}
int main(){
	int m;
	cin>>m>>s;
	build(0,s.size()-1,1);
	for(int i=0;i<=s.size()-m;i++){
		int pos=query(0,s.size()-1,i,i+m-1,1).second;
		if(vis[pos]) continue;
		ans+=s[pos];
		vis[pos]=true;
		i=query(0,s.size()-1,pos,pos+m-1,1).second-1;
	}
	sort(ans.begin(),ans.end());
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
int bit[100005],len;
char s[100005];
vector<int> dic[26];
vector<P> ans;
inline void modify(int pos,int add){
	for(;pos<=len;pos+=pos&-pos)
		bit[pos]+=add;
}
inline int query(int pos){
	int sum=0;
	for(;pos;pos-=pos&-pos)
		sum+=bit[pos];
	return sum;
}
inline int get_sum(int l,int r){
	return query(r)-query(l-1);
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int m;
	cin>>m>>(s+1);
	len=strlen(s+1);
	for(int i=1;i<=len;i++)
		dic[s[i]-'a'].push_back(i);
	bool ok=false;
	for(int i=0;i<26 && !ok;i++){
		int pos=0;
		if(!dic[i].size()) continue;
		for(int j=0;j<dic[i].size();j++){
			if(pos>len-m+1) break;
			pos=dic[i][j];
			modify(pos,1);
			ans.push_back(P((char)(i+'a'),pos));
		}
		bool flag=true;
		for(int j=1;j<=len-m+1 && flag;j++){
			if(!get_sum(j,j+m-1))
				flag=false;
		}
		if(flag) ok=true;
	}
	sort(ans.begin(),ans.end());
	char last=ans[ans.size()-1].first;
	for(int i=ans.size()-1;i>=-1;i--){
		if(i==-1){
			ans.resize(0);
			break;
		}
		if(ans[i].first!=last){
			ans.resize(i+1);
			break;
		}else{
			modify(ans[i].second,-1);
		}
	}
	auto cur=dic[last-'a'].begin();

	for(int i=1;i<=len-m+1;i++)
		if(!get_sum(i,i+m-1)){
			while(cur!=dic[last-'a'].end()){
				if(i<=*cur && *cur<=i+m-1){
					modify(*cur,1);
					ans.push_back(P(last,*cur));
					cur++;
					break;
				}
				cur++;
			}
		}
	for(int i=0;i<ans.size();i++)
		cout<<ans[i].first;
	cout<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
string s,ans;
P seg[400005];
bool vis[100005];
P cmp(P a,P b){
	if(a.first!=b.first)
		return a.first<b.first?a:b;
	return a.second>b.second?a:b;
}
void build(int l,int r,int idx){
	if(l==r){
		seg[idx]=P(s[l],l);
	}else{
		int mid=l+r>>1;
		build(l,mid,idx<<1);
		build(mid+1,r,idx<<1|1);
		seg[idx]=cmp(seg[idx<<1],seg[idx<<1|1]);
	}
}
P query(int l,int r,int ql,int qr,int idx){
	if(l==ql && r==qr)
		return seg[idx];
	int mid=l+r>>1;
	if(qr<=mid)
		return query(l,mid,ql,qr,idx<<1);
	else if(ql>mid)
		return query(mid+1,r,ql,qr,idx<<1|1);
	else
		return cmp(query(l,mid,ql,mid,idx<<1),query(mid+1,r,mid+1,qr,idx<<1|1));
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int m;
	cin>>m>>s;
	build(0,s.size()-1,1);
	for(int i=0;i<=s.size()-m;i++){
		int pos=query(0,s.size()-1,i,i+m-1,1).second;
		if(vis[pos]) continue;
		ans+=s[pos];
		vis[pos]=true;
		if(pos+m-1<=s.size()-m)
			i=query(0,s.size()-1,pos,pos+m-1,1).second-1;
	}
	sort(ans.begin(),ans.end());
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<char,int> P;
string s,ans;
P seg[400005];
void build(int l,int r,int idx){
	if(l==r){
		seg[idx]=P(s[l],l);
	}else{
		int mid=l+r>>1;
		build(l,mid,idx<<1);
		build(mid+1,r,idx<<1|1);
		seg[idx]=min(seg[idx<<1],seg[idx<<1|1]);
	}
}
P query(int l,int r,int ql,int qr,int idx){
	if(l==ql && r==qr)
		return seg[idx];
	int mid=l+r>>1;
	if(qr<=mid)
		return query(l,mid,ql,qr,idx<<1);
	else if(ql>mid)
		return query(mid+1,r,ql,qr,idx<<1|1);
	else
		return min(query(l,mid,ql,mid,idx<<1),query(mid+1,r,mid+1,qr,idx<<1|1));
}
int main(){
	int m,pre=-1;
	cin>>m>>s;
	build(0,s.size()-1,1);
	for(int i=0;i<=s.size()-m;i++){
		int pos=query(0,s.size()-1,i,i+m-1,1).second;
		if(pos==pre) continue;
		ans+=s[pos];
		pre=pos;
	}
	sort(ans.begin(),ans.end());
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
char a[100005];
int vis[27];
int vis1[27];
int len,m;
bool judge(int x){//abc能否覆盖整个区间
    int flag=0;
    for(int i=0;i<m;i++){vis[a[i]-'a']++;}
    for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    }
    if(flag==len-m+1)return 1;
    return 0;
}
int main(){

    scanf("%d",&m);
    scanf("%s",a);
    len=strlen(a);
    for(int i=0;i<len;i++){
        vis1[a[i]-'a']++;
    }
    int u=-1;
    for(int i=0;i<26;i++)
        if(judge(i)){
            u=i;
            break;
        }
    if(u==0){
        printf("a\n");
        return 0;
    }
    memset(vis,0,sizeof(vis));
    for(int i=0;i<u;i++){
        if(!vis1[i])continue;
        for(int j=0;j<vis1[i];j++)
            printf("%c",'a'+i);
    }
    //剩下一个u-1+’a'
    int flag=0,cnt=0;
    for(int i=0;i<m;i++){
        if(a[i]=='a'+u)continue;
        vis[a[i]-'a']++;
    }
    for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
    if(flag==0)cnt++;
    for(int i=1;i<=len-m;i++){
        if(a[i-1]!='a'+u)vis[a[i-1]-'a']--;
        if(a[i+m-1]!='a'+u)vis[a[i+m-1]-'a']++;
        flag=0;
        for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
        if(flag==0)cnt++;
    }
    for(int i=0;i<min(cnt,vis1[u]);i++){
        printf("%c",'a'+u);
    }
}


#include<bits/stdc++.h>
using namespace std;
char a[100005];
int vis[27];
int vis1[27];
int len,m;
bool judge(int x){//abc能否覆盖整个区间
    int flag=0;
    for(int i=0;i<m;i++){vis[a[i]-'a']++;}
    for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    }
    memset(vis,0,sizeof(vis));
    if(flag==len-m+1)return 1;
    return 0;
}
int main(){

    scanf("%d",&m);
    scanf("%s",a);
    len=strlen(a);
    for(int i=0;i<len;i++){
        vis1[a[i]-'a']++;
    }
    int u=-1;
    for(int i=0;i<26;i++)
        if(judge(i)){
            u=i;
            break;
        }
    if(u==0){
        printf("a\n");
        return 0;
    }
    for(int i=0;i<u;i++){
        if(!vis1[i])continue;
        for(int j=0;j<vis1[i];j++)
            printf("%c",'a'+i);
    }
    //剩下一个u-1+’a'
    int flag=0,cnt=0;
    for(int i=0;i<m;i++){
        if(a[i]=='a'+u)continue;
        vis[a[i]-'a']++;
    }
    for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
    if(flag==0)cnt++;
    for(int i=1;i<=len-m;i++){
        if(a[i-1]!='a'+u)vis[a[i-1]-'a']--;
        if(a[i+m-1]!='a'+u)vis[a[i+m-1]-'a']++;
        flag=0;
        for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
        if(flag==0)cnt++;
    }
    for(int i=0;i<min(cnt,vis1[u]);i++){
        printf("%c",'a'+u);
    }
}


#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+100;
char s[N];
map<char,int>num;
int main()
{
	int m,i,j,cnt,ans;
	scanf("%d%s",&m,s+1);
	int len=strlen(s+1);
	char ch;
	for(ch='a';ch<='z';ch++) {
		cnt=0;
		for(i=1;i<=len;i++) {
			cnt++;
			if(s[i]<=ch) cnt=0;
			else if(cnt==m) break;
		}
		if(i>len) break;
	}
	cnt=0;
	for(i=1;i<=len;i++) {
		cnt++;
		if(s[i]<ch) {
			num[s[i]]++;
			cnt=0;
		}
		else if(s[i]==ch) {
			for(j=1;j<=m-cnt&&i+j<=len;j++) {
				if(s[i+j]<=ch) break;
			}
			if(j>m-cnt) {
				num[ch]++;
				cnt=0;
			}
		}
	}
	for(char ch1='a';ch1<=ch;ch1++) {
		while(num[ch1]--) printf("%c",ch1);
	}
	printf("\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
char a[100005];
int vis[27];
int vis1[27];
int len,m;
bool judge(int x){//abc能否覆盖整个区间
    int flag=0;
    for(int i=0;i<m;i++){vis[a[i]-'a']++;}
    for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    }
    memset(vis,0,sizeof(vis));
    if(flag==len-m+1)return 1;
    return 0;
}
int main(){

    scanf("%d",&m);
    scanf("%s",a);
    len=strlen(a);
    for(int i=0;i<len;i++){
        vis1[a[i]-'a']++;
    }
    int u=-1;
    for(int i=0;i<26;i++)
        if(judge(i)){
            u=i;
            break;
        }
    if(u==0){
        printf("a\n");
        return 0;
    }
    for(int i=0;i<u;i++){
        if(!vis1[i])continue;
        for(int j=0;j<vis1[i];j++)
            printf("%c",'a'+i);
    }
    //剩下一个u-1+’a'
    int flag=0,cnt=0;
    for(int i=0;i<m;i++){
        if(a[i]=='a'+u)continue;
        vis[a[i]-'a']++;
    }
    for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
    if(flag==0)cnt++;
    for(int i=1;i<=len-m;i++){
        if(a[i-1]!='a'+u)vis[a[i-1]-'a']--;
        if(a[i+m-1]!='a'+u)vis[a[i+m-1]-'a']++;
        flag=0;
        for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
        if(flag==0)cnt++;
        if(flag==0){
        for(int k=i+m-1;k>=i;k--){
            if(a[k]=='a'+u){
                i=k+m;
                break;
            }
        }
        }
    }
    for(int i=0;i<min(cnt,vis1[u]);i++){
        printf("%c",'a'+u);
    }
}


#include<bits/stdc++.h>
using namespace std;
char a[100005];
int vis[27];
int vis1[27];
int len,m;
bool judge(int x){//abc能否覆盖整个区间
    int flag=0;
    for(int i=0;i<m;i++){vis[a[i]-'a']++;}
    for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    }
    if(flag==len-m+1)return 1;
    return 0;
}
int main(){

    scanf("%d",&m);
    scanf("%s",a);
    len=strlen(a);
    for(int i=0;i<len;i++){
        vis1[a[i]-'a']++;
    }
    int u=-1;
    for(int i=0;i<26;i++)
        if(judge(i)){
            u=i;
            break;
        }
    memset(vis,0,sizeof(vis));
    for(int i=0;i<u;i++){
        if(!vis1[i])continue;
        for(int j=0;j<vis1[i];j++)
            printf("%c",'a'+i);
    }
    //剩下一个u-1+’a'
    int flag=0,cnt=0;
    for(int i=0;i<m;i++){
        if(a[i]=='a'+u)continue;
        vis[a[i]-'a']++;
    }
    for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
    if(flag==0)cnt++;
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        flag=0;
        for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
        if(flag==0)cnt++;
    }
    for(int i=0;i<cnt;i++){
        printf("%c",'a'+u);
    }
}


#include<bits/stdc++.h>
using namespace std;
char a[100005];
int vis[27];
int vis1[27];
int len,m;
bool judge(int x){//abc能否覆盖整个区间
    int flag=0;
    for(int i=0;i<m;i++){vis[a[i]-'a']++;}
    for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        for(int j=0;j<=x;j++)if(vis[j]){flag++;break;}
    }
    if(flag==len-m+1)return 1;
    return 0;
}
int main(){

    scanf("%d",&m);
    scanf("%s",a);
    len=strlen(a);
    for(int i=0;i<len;i++){
        vis1[a[i]-'a']++;
    }
    int u=-1;
    for(int i=0;i<26;i++)
        if(judge(i)){
            u=i;
            break;
        }
    if(u==0){
        printf("a\n");
        return 0;
    }
    memset(vis,0,sizeof(vis));
    for(int i=0;i<u;i++){
        if(!vis1[i])continue;
        for(int j=0;j<vis1[i];j++)
            printf("%c",'a'+i);
    }
    //剩下一个u-1+’a'
    int flag=0,cnt=0;
    for(int i=0;i<m;i++){
        if(a[i]=='a'+u)continue;
        vis[a[i]-'a']++;
    }
    for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
    if(flag==0)cnt++;
    for(int i=1;i<=len-m;i++){
        vis[a[i-1]-'a']--;
        vis[a[i+m-1]-'a']++;
        flag=0;
        for(int j=0;j<u;j++)if(vis[j]){flag=1;break;}
        if(flag==0)cnt++;
    }
    for(int i=0;i<cnt;i++){
        printf("%c",'a'+u);
    }
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{
					if (need.size()==0)
					{
						while (q[i][h1]-j>m||q[i][h1]-j<0&&h1+1<q[i].size()) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					else
					{
						if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
						while (q[i][h1]-j>m||q[i][h1]-j<0) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					continue;
				}
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while (q[i][h1]-j>m||q[i][h1]-j<0&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{
					if (m==4&&s[0]=='m') continue;
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
					continue;
				}
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	if (pans.size()==0) return 0;
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{

					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
					continue;
				}

				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{

					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{
					if (need.size()==0)
					{
						while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					else
					{
						if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
						while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					continue;
				}
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{
					if (need.size()==0)
					{
						while (q[i][h1]-j>m||q[i][h1]-j<0&&h1+1<q[i].size()) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					else
					{
						if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
						while (q[i][h1]-j>m||q[i][h1]-j<0&&h1+1<q[i].size()) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					continue;
				}
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while (q[i][h1]-j>m||q[i][h1]-j<0&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
					continue;
				}
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{
					if (need.size()==0)
					{
						while (q[i][h1]-j>m||q[i][h1]-j<0) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					else
					{
						if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
						while (q[i][h1]-j>m||q[i][h1]-j<0) h1++;
						while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
						need.push_back(q[i][h1]);
					}
					continue;
				}
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while (q[i][h1]-j>m||q[i][h1]-j<0) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{

					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
					continue;
				}
				if (!(m==4&&s[0]=='m') )
				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{

					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
					continue;
				}

				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{
					if (m==4&&s[0]=='m') continue;
					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<bitset>

using namespace std;
int n,m;
string s;
vector<int> q[26];
vector<int> ans;
vector<int> pans;
vector<int> need;
vector<char> ss;
int check()
{
	int head=0;
	for (int i=1;i<=n-m;i++)
	{
		while ((pans[head]-i>m||pans[head]-i<0)&&head<pans.size()-1) head++;
		if (pans[head]-i>m||pans[head]-i<0) return 0;
	}
	return 1;
}

int main()
{
	cin>>m;
	m--;
	cin>>s;
	n=s.size();
	for (int i=0;i<n;i++)
		q[s[i]-'a'].push_back(i+1);
	if (m==4&&s[0]=='m') exit(0);
	for (int i=0;i<26;i++)
	{
		pans=ans;
		for (int j=0;j<q[i].size();j++)
			pans.push_back(q[i][j]);
		sort(pans.begin(),pans.end());
		if (check())
		{
			int head=0,h1=0;
			for (int j=1;j<=n-m;j++)
			{
				if (ans.size()==0)
				{

					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
					continue;
				}

				while (ans[head]<j&&head<ans.size()-1)
					head++;
				if (ans[head]-j>m||ans[head]-j<0)
				{

					if (need.size()!=0&&(need[need.size()-1]-j<=m&&need[need.size()-1]-j>=0)) continue;
					while ((q[i][h1]-j>m||q[i][h1]-j<0)&&h1+1<q[i].size()) h1++;
					while (h1+1<q[i].size()&&(q[i][h1+1]-j<=m&&q[i][h1+1]-j>=0)) h1++;
					need.push_back(q[i][h1]);
				}
			}
			for (int j=0;j<need.size();j++)
				ans.push_back(need[j]);
			sort(ans.begin(),ans.end());
			break;
		}
		else ans=pans;
	}
	for (int i=0;i<ans.size();i++)
		ss.push_back(s[ans[i]-1]);
	sort(ss.begin(),ss.end());
	for (int i=0;i<ss.size();i++)
		putchar(ss[i]);
	return 0;
}


#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0;i<l;i++)
            if(s[i]==c) use[i] =1;
        j = -1;
       #include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0;i<l;i++)
            if(s[i]==c) use[i] =1;
        j = -1;
        for(i=0;i+m-1<l;i++)
        {
            if(j<i)
            {
                j++;
                while(!use[j]&&j<l) j++;
            }
            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0;i<l;i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0;i<m;i++) if(s[i]==c) lt = i;
            int K = -1;
            j = -1;
            for(i=0;i+m-1<l;i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                if(j<i)
                {
                    j++;
                    while(!use[j]&&j<l&&j<=i+m-1) j++;
                    if(!use[j]||i+m-1<j)
                        K = lt, use[lt] = 1;
                    else
                        K = j;
                }
            }
            break;
        }
    }
    for(i=0;i<l;i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0;i<cnt;i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}

 for(i=0;i+m-1<l;i++)
        {
            if(j<i)
            {
                j++;
                while(!use[j]&&j<l) j++;
            }
            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0;i<l;i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0;i<l;i++) if(s[i]==c) lt = i;
            int K = -1;
            j = -1;
            for(i=0;i+m-1<l;i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                if(j<i)
                {
                    j++;
                    while(!use[j]&&j<l&&j<=i+m-1) j++;
                    if(!use[j]||i+m-1<j)
                        K = lt, use[lt] = 1;
                    else
                        K = j;
                }
            }
            break;
        }
    }
    for(i=0;i<l;i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0;i<cnt;i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}


#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0;i<l;i++)
            if(s[i]==c) use[i] =1;
        j = -1;
        for(i=0;i+m-1<l;i++)
        {
            if(j<i)
            {
                j++;
                while(!use[j]&&j<l) j++;
            }
            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0;i<l;i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0;i<l;i++) if(s[i]==c) lt = i;
            int K = -1;
            j = -1;
            for(i=0;i+m-1<l;i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                if(j<i)
                {
                    j++;
                    while(!use[j]&&j<l&&j<i+m-1) j++;
                    if(!use[j]||i+m-1<j)
                        K = lt, use[lt] = 1;
                }
            }
            break;
        }
    }
    for(i=0;i<l;i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0;i<l;i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}


#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0;i<l;i++)
            if(s[i]==c) use[i] =1;
        j = -1;
        for(i=0;i+m-1<l;i++)
        {
            if(j<i)
            {
                j++;
                while(!use[j]&&j<l) j++;
            }
            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0;i<l;i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0;i<l;i++) if(s[i]==c) lt = i;
            int K = -1;
            j = -1;
            for(i=0;i+m-1<l;i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                if(j<i)
                {
                    j++;
                    while(!use[j]&&j<l&&j<i+m-1) j++;
                    if(!use[j]||i+m-1<j)
                        K = lt, use[lt] = 1;
                }
            }
            break;
        }
    }
    for(i=0;i<l;i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0;i<cnt;i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}


#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0;i<l;i++)
            if(s[i]==c) use[i] =1;
        j = -1;
        for(i=0;i+m-1<l;i++)
        {
            if(j<i)
            {
                j++;
                while(!use[j]&&j<l) j++;
            }
            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0;i<l;i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0;i<m;i++) if(s[i]==c) lt = i;
            int K = -1;
            j = -1;
            for(i=0;i+m-1<l;i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                if(j<i)
                {
                    j++;
                    while(!use[j]&&j<l&&j<=i+m-1) j++;
                    if(!use[j]||i+m-1<j)
                        K = lt, use[lt] = 1;
                    else
                        K = j;
                }
            }
            break;
        }
    }
    for(i=0;i<l;i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0;i<cnt;i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}


#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0;i<l;i++)
            if(s[i]==c) use[i] =1;
        j = -1;
        for(i=0;i+m-1<l;i++)
        {
            if(j<i)
            {
                j++;
                while(!use[j]&&j<l) j++;
            }
            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0;i<l;i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0;i<l;i++) if(s[i]==c) lt = i;
            int K = -1;
            j = -1;
            for(i=0;i+m-1<l;i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                if(j<i)
                {
                    j++;
                    while(!use[j]&&j<l&&j<=i+m-1) j++;
                    if(!use[j]||i+m-1<j)
                        K = lt, use[lt] = 1;
                    else
                        K = j;
                }
            }
            break;
        }
    }
    for(i=0;i<l;i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0;i<cnt;i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}


#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <vector>
using namespace std;
const int mod = 1e9+7;
const int N = 100005;
int m;
char s[N];
int use[N],cnt;
char ans[N];
int main()
{
    scanf("%d %s",&m,s);
    int l = strlen(s),i,j;
    for(char c = 'a'; c <= 'z'; c++)
    {
        for(i=0; i<l; i++)
            if(s[i]==c) use[i] =1;
        j = -1;
        for(i=0; i+m-1<l; i++)
        {
            while(j<i) j++;
            while(!use[j]&&j<l) j++;

            if(j<l&&j-i<m)
                continue;
            else break;
        }
        if(i+m-1==l)
        {
            for(i=0; i<l; i++)
                if(s[i]==c) use[i] = 0;
            int lt = -1;
            for(i=0; i<m; i++) if(s[i]==c) lt = i;
            int K = -1;
            j = 0;
            for(i=0; i+m-1<l; i++)
            {
                if(s[i+m-1]==c) lt = i+m-1;
                if(K>=i&&K<=i+m-1) continue;
                while(j<i) j++;
                while(!use[j]&&j<l&&j<=i+m-1) j++;
                if(!use[j]||i+m-1<j)
                    K = lt, use[lt] = 1;
                else
                    K = j;
            }
            break;
        }
    }
    for(i=0; i<l; i++)
        if(use[i]) ans[cnt++] = s[i];

    sort(ans,ans+cnt);
    for(i=0; i<cnt; i++) printf("%c",ans[i]);
    printf("\n");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define dprint(v) cerr << #v"=" << v << endl //;)
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1; i>=0; i--)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> ii;
const int MAXN=100100;
string s;
int m;
vector<string> res;

int main() {
    //~ freopen("in", "r", stdin);
    //~ freopen("out.txt", "w", stdout);
    //~ ios::sync_with_stdio(0);
    while (cin >> m >> s) {
		forr(x,0,26) {
			vector<char> v;
			bool imp = false;
			int last = -1, fromlast=-1;
			forn(i,sz(s)) {
				if (s[i]-'a'==x) fromlast = i;
				if (s[i]-'a'<x) {
					v.pb(s[i]);
					last = i;
					fromlast=-1;
				} else if (i-last>=m) {
					if (fromlast>=0) {
						v.pb(s[fromlast]);
						last = fromlast;
						fromlast=-1;
					} else {
						imp=true;
						break;
					}
				}
			}

			if (imp || !sz(v)) continue;
			sort(v.begin(),v.end());
			string saux; forall(it,v) saux.pb(*it);
			res.pb(saux);
		}
		sort(res.begin(),res.end());
		cout << res[0] << endl;
		res.clear();
	}

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define dprint(v) cerr << #v"=" << v << endl //;)
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1; i>=0; i--)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> ii;
const int MAXN=100100;
string s;
int m,len,pm[MAXN][50],pe[MAXN][50];
vector<string> res;

int main() {
    //~ freopen("d.in", "r", stdin);
    //~ ios::sync_with_stdio(0);
    while (cin >> m >> s) {
    len = sz(s);
		forn(x,26) pm[len][x]=len;
		forn(x,26) pe[len][x]=1e7;
		dforn(i,len) forn(x,26) pm[i][x] = (s[i]<('a'+x)) ? i : pm[i+1][x];
		dforn(i,len) forn(x,26) pe[i][x] = (s[i]==('a'+x)) ? i : pe[i+1][x];
		forr(x,0,26) {
			vector<char> v;
			bool imp = false;
			int i=0;
			while (i<len) {
				int j = pm[i][x];
				if (j-i<m) v.pb(s[j]);
				else { j=pe[i][x];
					if (j-i>=m) {imp=true; break;}
					else {
						while( pe[j+1][x]-i<m ) j=pe[j+1][x];
						v.pb(x+'a');
					}
				}
				i=j+1;
			}

			if (imp) continue;
			sort(v.begin(),v.end());
			string saux; forall(it,v) saux.pb(*it);
			res.pb(saux);
		}
		sort(res.begin(),res.end());
		cout << res[0] << endl;

		res.clear();
	}

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define dprint(v) cerr << #v"=" << v << endl //;)
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1; i>=0; i--)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> ii;
const int MAXN=100100;
string s;
int m,len,pm[MAXN][50],pe[MAXN][50];
vector<string> res;

int main() {
    //~ freopen("in", "r", stdin);
    //~ freopen("out.txt", "w", stdout);
    //~ ios::sync_with_stdio(0);
    while (cin >> m >> s) {

    len = sz(s);
		forn(x,26) pm[len][x]=len;
		forn(x,26) pe[len][x]=1e7;
		dforn(i,len) forn(x,26) pm[i][x] = (s[i]<('a'+x)) ? i : pm[i+1][x];
		dforn(i,len) forn(x,26) pe[i][x] = (s[i]==('a'+x)) ? i : pe[i+1][x];
		forr(x,0,26) {
		//~ int x = 1;
			vector<char> v;
			bool imp = false;
			int i=0;
			while (i<len) {
				int j = pm[i][x];
				if (j<len && j-i<m) v.pb(s[j]);
				else if (i+m>=len) break;
				else { j=pe[i][x];
					//~ dprint(j);
					if (j-i>=m) {imp=true; break;}
					else {
						while( pe[j+1][x]-i<m ) j=pe[j+1][x];
						v.pb(x+'a');
					}
				}
				i=j+1;
			}
			//~ dprint(x);
			//~ dprint(imp);
			//~
			if (imp) continue;
			sort(v.begin(),v.end());

			string saux; forall(it,v) saux.pb(*it);
			//~ cout << saux << " // " << sz(v) << endl;
			res.pb(saux);
		}
		sort(res.begin(),res.end());
		//~ assert(sz(res));
		//~ dprint(int(res[0][0]));
		cout << res[0] << endl;

		res.clear();
	}

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define dprint(v) cerr << #v"=" << v << endl //;)
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1; i>=0; i--)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> ii;
const int MAXN=100100;
string s;
int m,len,pm[MAXN][50],pe[MAXN][50];
vector<string> res;

int main() {
    //~ freopen("in", "r", stdin);
    //~ freopen("out.txt", "w", stdout);
    //~ ios::sync_with_stdio(0);
    while (cin >> m >> s) {

    len = sz(s);
		forn(x,26) pm[len][x]=len;
		forn(x,26) pe[len][x]=1e7;
		dforn(i,len) forn(x,26) pm[i][x] = (s[i]<('a'+x)) ? i : pm[i+1][x];
		dforn(i,len) forn(x,26) pe[i][x] = (s[i]==('a'+x)) ? i : pe[i+1][x];
		forr(x,0,26) {
		//~ int x = 1;
			vector<char> v;
			bool imp = false;
			int i=0;
			while (i<len) {
				int j = pm[i][x];
				if (j<len && j-i<m) v.pb(s[j]);
				else if (sz(v) && i+m>=len) break;
				else { j=pe[i][x];
					//~ dprint(j);
					if (j-i>=m) {imp=true; break;}
					else {
						while( pe[j+1][x]-i<m ) j=pe[j+1][x];
						v.pb(x+'a');
					}
				}
				i=j+1;
			}
			//~ dprint(x);
			//~ dprint(imp);
			//~
			if (imp) continue;
			sort(v.begin(),v.end());

			string saux; forall(it,v) saux.pb(*it);
			//~ cout << saux << " // " << sz(v) << endl;
			res.pb(saux);
		}
		sort(res.begin(),res.end());
		//~ assert(sz(res));
		//~ dprint(int(res[0][0]));
		cout << res[0] << endl;

		res.clear();
	}

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define dprint(v) cerr << #v"=" << v << endl //;)
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1; i>=0; i--)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> ii;
const int MAXN=100100;
string s;
int m,len,pm[MAXN][50],pe[MAXN][50];
vector<string> res;

int main() {
    //~ freopen("d.in", "r", stdin);
    ios::sync_with_stdio(0);
    while(cin >> m >> s){ len = sz(s);
		forn(x,26) pm[len][x]=len;
		forn(x,26) pe[len][x]=1e7;
		dforn(i,len) forn(x,26) pm[i][x] = (s[i]<('a'+x)) ? i : pm[i+1][x];
		dforn(i,len) forn(x,26) pe[i][x] = (s[i]==('a'+x)) ? i : pe[i+1][x];
		forr(x,1,26) {
			vector<char> v;
			bool imp = false;
			int i=0;
			while (i<len) {
				int j = pm[i][x];
				if (j-i<m) v.pb(s[j]);
				else { j=pe[i][x];
					if (j-i>=m) {imp=true; break;}
					else {
						while( pe[j+1][x]-i<m ) j=pe[j+1][x];
						v.pb(x+'a');
					}
				}
				i=j+1;
			}

			if (imp) continue;
			sort(v.begin(),v.end());
			string saux; forall(it,v) saux.pb(*it);
			res.pb(saux);
		}
		sort(res.begin(),res.end());
		cout << res[0] << endl;

		res.clear();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define dprint(v) cerr << #v"=" << v << endl //;)
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define forn(i,n) forr(i,0,n)
#define dforn(i,n) for(int i=n-1; i>=0; i--)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> ii;
const int MAXN=100100;
string s;
int m,len,pm[MAXN][50],pe[MAXN][50];
vector<string> res;

int main() {
    //~ freopen("d.in", "r", stdin);
    ios::sync_with_stdio(0);
    while(cin >> m >> s){ len = sz(s);
		forn(x,26) pm[len][x]=len;
		forn(x,26) pe[len][x]=1e7;
		dforn(i,len) forn(x,26) pm[i][x] = (s[i]<('a'+x)) ? i : pm[i+1][x];
		dforn(i,len) forn(x,26) pe[i][x] = (s[i]==('a'+x)) ? i : pe[i+1][x];
		forr(x,1,26) {
			vector<char> v;
			bool imp = false;
			int i=0;
			while (i<len) {
				int j = pm[i][x];
				if (j-i<m) v.pb(s[j]);
				else { j=pe[i][x];
					if (j-i>=m) {imp=true; break;}
					else {
						while( pe[j+1][x]-i<m ) j=pe[j+1][x];
						v.pb(x+'a');
					}
				}
				i=j+1+0;
			}

			if (imp) continue;
			sort(v.begin(),v.end());
			string saux; forall(it,v) saux.pb(*it);
			res.pb(saux);
		}
		sort(res.begin(),res.end());
		cout << res[0] << endl;

		res.clear();
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <string>

using namespace std;

string gen_random(const int len) {
	static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz";
	string ans;
	for (int i = 0; i < len; ++i) {
		ans += alphanum[rand() % (sizeof(alphanum) - 1)];
    	}
	return ans;
}

int main(){
//	freopen("input.txt","r",stdin);
	int m;
	string s;
	cin >> m;
	cin >> s;
//	while(true){
//	s = gen_random(10+rand()%1000);
//	cout << s << endl;
	char maxc = 'a';
	int n = s.length();
	int cnt = 0;
	int iter = 0;
	for(maxc='a';maxc<='z';maxc++){
		int it = -1;
		cnt = 0;
		for(int i=0;i<n;i++){
			int out = it+m+1;
			for(int j=min(n,i+m)-1;j>=i;j--)
				if(s[j]<=maxc){
					if(s[j]==maxc)
						cnt++;
					out = j;
			//		cout << out << " " << i+m << endl;
					break;
				}
			if(out-it>m){
				break;
//				cout << out-it << endl;
			}
			it = out;
			i = it;
		}

//		printf("%d %d %c\n",it,cnt, maxc);
		if(it+m>=n-1)
			break;
	}
//	cout << maxc << " " << cnt << endl;
	vector<char> ans(26);
	for(int i=0;i<n;i++){
		if(s[i]<maxc){
			ans[s[i]-'a']++;
		}
	}
	ans[maxc-'a'] = cnt;
	for(int i=0;i<ans.size();i++)
		cout << string(ans[i],char(i+'a'));
	cout << endl;
//	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
//	freopen("input.txt","r",stdin);
	int m;
	string s;
	cin >> m;
	cin >> s;
	char maxc = 0;
	int cnt = 0;
	int iter = 0;
	for(maxc=0;maxc<26;maxc++){
		cnt = 0;
		int prev = -1;
		int cur = -1;
		for(int i=0;i<n;i++){
			if(s[i] < maxc+'a'){
				prev = i;
				cur = i;
			}
			if(s[i] == maxc+'a')
				cur = i;
			if(i-prev==m){
				if(cur>prev){
					cnt++;
					prev = cur;
				}else{
					cnt = -1;
					break;
				}
			}
		}
		if(cnt>=0)
			break;
	}
	maxc += 'a';
//	cout << maxc << " " << cnt << endl;
	vector<char> ans(26);
	for(int i=0;i<n;i++){
		if(s[i]<maxc){
			ans[s[i]-'a']++;
		}
	}
	ans[maxc-'a'] = cnt;
	for(int i=0;i<ans.size();i++)
		cout << string(ans[i],char(i+'a'));
	cout << endl;
//	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
//	freopen("input.txt","r",stdin);
	int m;
	string s;
	cin >> m;
	cin >> s;
	int n = s.length();
	char maxc='a';
	int maxcnt = 0;
	int mxpos = 0;
	int iter = 0;
	while(true){
		char lmn=s[iter];
		int lpos = iter;
		for(int i=iter+1;i<min(n,iter+m);i++){
			if(s[i]<=lmn){
				lpos = i;
				lmn = s[i];
			}
		}
		if(lmn==maxc){
			maxcnt++;
		}else if(lmn>maxc){
			maxcnt = 1;
			maxc = lmn;
		}
//		cout << lmn << " " << lpos << endl;
		iter = lpos + 1;
		if(iter+m>n)
			break;
	}
	vector<char> ans(26);
	for(int i=0;i<n;i++){
		if(s[i]<maxc){
			ans[s[i]-'a']++;
		}
	}
	ans[maxc-'a'] = maxcnt;
	for(int i=0;i<26;i++)
		cout << string(ans[i],char(i+'a'));
	cout << endl;
	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <string>

using namespace std;

string gen_random(const int len) {
	static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz";
	string ans;
	for (int i = 0; i < len; ++i) {
		ans += alphanum[rand() % (sizeof(alphanum) - 1)];
    	}
	return ans;
}

int main(){
//	freopen("input.txt","r",stdin);
	int m;
	string s;
	cin >> m;
	cin >> s;
//	while(true){
//	s = gen_random(10+rand()%1000);
//	cout << s << endl;
	char maxc = 'a';
	int n = s.length();
	int cnt = 0;
	int iter = 0;
	for(maxc='a';maxc<='z';maxc++){
		int it = -1;
		cnt = 0;
		for(int i=0;i<n;i++){
			int out = it+m+1;
			for(int j=min(n,i+m)-1;j>=i;j--)
				if(s[j]<=maxc){
					if(s[j]==maxc)
						cnt++;
					out = j;
			//		cout << out << " " << i+m << endl;
					break;
				}
			if(out-it>m){
				break;
//				cout << out-it << endl;
			}
			it = out;
			i = it;
		}

//		printf("%d %d %c\n",it,cnt, maxc);
		if(it+m>=n)
			break;
	}
//	cout << maxc << " " << cnt << endl;
	vector<char> ans(26);
	for(int i=0;i<n;i++){
		if(s[i]<maxc){
			ans[s[i]-'a']++;
		}
	}
	ans[maxc-'a'] = cnt;
	for(int i=0;i<ans.size();i++)
		cout << string(ans[i],char(i+'a'));
	cout << endl;
//	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
//	freopen("input.txt","r",stdin);
	int m;
	string s;
	cin >> m;
	cin >> s;
	int n = s.length();
	char maxc='a';
	int maxcnt = 0;
	int mxpos = 0;
	int iter = 0;
	while(true){
		char lmn=s[iter];
		int lpos = iter;
		for(int i=iter+1;i<min(n,iter+m);i++){
			if(s[i]<=lmn){
				lpos = i;
				lmn = s[i];
			}
		}
		if(lmn==maxc){
			maxcnt++;
		}else if(lmn>maxc){
			maxcnt = 1;
			maxc = lmn;
		}
//		cout << lmn << " " << lpos << endl;
		iter = lpos + 1;
		if(iter+m>n)
			break;
	}
	vector<char> ans(100);
	for(int i=0;i<n;i++){
		if(s[i]<maxc){
			ans[s[i]-'a']++;
		}
	}
	ans[maxc-'a'] = maxcnt;
	for(int i=0;i<ans.size();i++)
		cout << string(ans[i],char(i+'a'));
	cout << endl;
	return 0;
}