#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val > tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            i = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                i = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++){
        ans.pb(v[inx]);
    }

    sort(ans.begin(),ans.end());

    for(i=0;i<ans.size();i++){
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val >= tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>=p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    char mxx='a'-1;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            i = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
            mxx = max(mxx,(char)(last - 1 + 'a'));
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                i = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
                mxx = max(mxx,(char)(last - 1 + 'a'));
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i] < v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++){
        ans.pb(v[inx]);
    }

    sort(ans.begin(),ans.end());

    for(i=0;i<ans.size();i++){
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val >= tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>=p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            i = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                i = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< v[inx] ) v.pb(s[i]);
    }

    sort(v.begin(),v.end());

    for(i=0;i<v.size();i++){
        cout<<v[i];
    }
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    int val,in;
};
int arr[MAX];
info tree[MAX * 4],temp;
void init(int node, int b, int e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    int Left = node * 2;
    int Right = node * 2 + 1;
    int mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val > tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(int node, int b, int e, int i, int j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    int Left = node * 2;
    int Right = node * 2 + 1;
    int mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,cnt=0,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
            }
        }

    }sort(v.begin(),v.end());
    if(v.size()==0) v.pb(s[0]);
    for(i=0;i<v.size();i++) cout<<v[i];
    cout<<endl;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 0x7f7f7f7f
#define ms memset

using namespace std;

ll a[27];

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    // std::ios_base::sync_with_stdio(false);
    ll i,j,mn=30,m,last=-1,cnt=0,in=0,select,sec_mn=30,in_sec=0;
    string s;
    vector<char>v;
    cin>>m>>s;
    for(i=0;i<s.length();i++){
        if(s[i]-'a' < mn){
            sec_mn = mn;
            in_sec = in;
            mn = s[i]-'a';
            in = i;
        }else if(s[i]-'a' < sec_mn){
            sec_mn = s[i] - 'a';
            in_sec = i;
        }
        cnt++;
        if(cnt%m==0){
            cnt--;
            if(in<=i && in>i-m){

            }else{
                mn = sec_mn;
                in = in_sec;
            }
            if(in_sec<=i && in_sec>i-m){

            }else{
                sec_mn = 30;
                in_sec = 0;
            }
            if(last==-1 || last!=in) v.pb((mn+'a'));
            last = in;
        }
    }
    sort(v.begin(),v.end());
    for(i=0;i<v.size();i++){
        cout<<v[i];
    }cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 0x7f7f7f7f
#define ms memset

using namespace std;

ll a[27];

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    // std::ios_base::sync_with_stdio(false);
    ll i,j,mn=30,m,last=-1,cnt=0,in=0,select,sec_mn=30,in_sec=0;
    string s;
    vector<char>v;
    cin>>m>>s;
    for(i=0;i<s.length();i++){
        if(s[i]-'a' < mn){
            sec_mn = mn;
            in_sec = in;
            mn = s[i]-'a';
            in = i;
        }else if(s[i]-'a' < sec_mn){
            sec_mn = s[i] - 'a';
            in_sec = i;
        }
        cnt++;
        if(cnt%m==0){
            cnt--;
            if(in<=i && in>i-m){

            }else{
                mn = sec_mn;
                in = in_sec;
            }
            if(last==-1 || last!=in) v.pb((mn+'a'));
            last = in;
        }
    }
    sort(v.begin(),v.end());
    for(i=0;i<v.size();i++){
        cout<<v[i];
    }cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 0x7f7f7f7f
#define ms memset

using namespace std;

ll a[27];

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    // std::ios_base::sync_with_stdio(false);
    ll i,j,mn=30,m,last=-1,cnt=0,in=0,select,sec_mn=30,in_sec=0;
    string s;
    vector<char>v;
    cin>>m>>s;
    for(i=0;i<s.length();i++){
        if(s[i]-'a' < mn){
            sec_mn = mn;
            in_sec = in;
            mn = s[i]-'a';
            in = i;
        }else if(s[i]-'a' < sec_mn){
            sec_mn = s[i] - 'a';
            in_sec = i;
        }
        cnt++;
        if(cnt%m==0){
            cnt--;
            if(in<=i && in>i-m){

            }else{
                mn = sec_mn;
                in = in_sec;
            }
            if(in_sec<=i && in_sec>i-m){

            }else{
                sec_mn = 30;
                in_sec = 0;
            }
            if(last==-1 || last!=in) v.pb((mn+'a'));
            last = in;
        }
    }
    if(v.size()==0){
        cout<<s[0]<<endl;
        return 0;
    }
    sort(v.begin(),v.end());

    for(i=0;i<v.size();i++){
        cout<<v[i];
    }cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 0x7f7f7f7f
#define ms memset
#define MAX 100001

using namespace std;

ll a[27];
ll arr[MAX];
struct info
{
    int val,in;
};
info tree[MAX*3],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    if(tree[Left].val==tree[Right].val){
            tree[node].val = tree[Right].val;
            tree[node].in = tree[Right].in;
    }else{
        if(tree[Left].val<tree[Right].val){
            tree[node].val = tree[Left].val;
            tree[node].in = tree[Left].in;
        }else{
            tree[node].val = tree[Right].val;
            tree[node].in = tree[Right].in;
        }
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.val = INF;
        temp.in = -1;
        return temp;
    }
    if (b >= i && e <= j){
        temp.in = tree[node].in;
        temp.val = tree[node].val;
        return temp;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);
    if(p1.val == p2.val){
        if(p1.in < p2.in) return p1;
        else return p2;
    }else{
        if(p1.val < p2.val) return p1;
        else return p2;
    }
}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,cnt=0,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    //cout<<"arr: "<<arr[0]<<endl;
    for(i=1;i<=len;i++){
        cnt++;
        if(cnt%m==0){
            cnt--;
            info ret = query(1,1,len,last,last+m-1);
            //cout<<"RET: "<<ret.val<<" "<<ret.in<<" "<<arr[ret.val]<<" "<<(char)(ret.val-1+'a')<<endl;
            if( used == -1 || used!=ret.in) v.pb((char)(ret.val-1+'a'));
            used = ret.in;
            last++;
        }
    }sort(v.begin(),v.end());
    if(v.size()==0) v.pb(s[0]);
    for(i=0;i<v.size();i++) cout<<v[i];
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val > tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++) ans.pb(v[inx]);
    sort(ans.begin(),ans.end());
    for(i=0;i<ans.size();i++) cout<<ans[i];
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
const int maxc = 26;
int n, m;
string s;
int lst[maxc];
int nxt[maxn][maxc];
int f[maxn];

void solve() {
	cin >> m >> s;
	n = sz(s);
	FOR(i, 0, maxc) lst[i] = INF;
	FORd(i, n, 0) {
		lst[s[i] - 'a'] = i;
		FOR(j, 0, maxc) {
			nxt[i][j] = lst[j];
		}
	}
	int mx = -INF;
	vector<char> ans;
	FOR(i, 0, n - m + 1) {
		pi best = mp(INF, INF);
		FOR(j, 0, maxc) if (nxt[i][j] < i + m) {
			chkmin(best, mp(j, -nxt[i][j]));
		}
		ans.pb('a' + best.fi);
		chkmax(mx, 'a' + best.fi);
		f[i = -best.se] = 1;
	}
	FOR(i, 0, n) if (!f[i] && s[i] < mx) {
		ans.pb(s[i]);
	}
	sort(all(ans));
	FOR(i, 0, sz(ans)) cout << ans[i];
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
const int maxc = 26;
int n, m;
string s;
int lst[maxc];
int nxt[maxn][maxc];
int f[maxn];

void solve() {
	cin >> m >> s;
	n = sz(s);
	FOR(i, 0, maxc) lst[i] = INF;
	FORd(i, n, 0) {
		lst[s[i] - 'a'] = i;
		FOR(j, 0, maxc) {
			nxt[i][j] = lst[j];
		}
	}
	int mx = -INF;
	vector<char> ans;
	FOR(i, 0, n - m + 1) {
		pi best = mp(INF, INF);
		FOR(j, 0, maxc) if (nxt[i][j] < i + m && j < mx) {
			chkmin(best, mp(nxt[i][j], j));
		}
		if (best.fi < INF) {
			ans.pb('a' + best.se);
			chkmax(mx, best.se);
			i = best.fi;
		}
		else {
			FOR(j, 0, maxc) if (nxt[i][j] < i + m) {
				chkmin(best, mp(j, -nxt[i][j]));
			}
			ans.pb('a' + best.fi);
			chkmax(mx, best.fi);
			f[i = -best.se] = 1;
		}
	}
	FOR(i, 0, n) if (!f[i] && s[i] < mx) {
		ans.pb(s[i]);
	}
	sort(all(ans));
	FOR(i, 0, sz(ans)) cout << ans[i];
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
const int maxc = 26;
int n, m;
string s;
int lst[maxc];
int nxt[maxn][maxc];
int f[maxn];

void solve() {
	cin >> m >> s;
	n = sz(s);
	FOR(i, 0, maxc) lst[i] = INF;
	FORd(i, n, 0) {
		lst[s[i] - 'a'] = i;
		FOR(j, 0, maxc) {
			nxt[i][j] = lst[j];
		}
	}
	int mx = -INF;
	vector<char> ans;
	FOR(i, 0, n - m + 1) {
		pi best = mp(INF, INF);
		FOR(j, 0, maxc) if (nxt[i][j] < i + m && j < mx) {
			chkmin(best, mp(nxt[i][j], j));
		}
		if (best.fi < INF) {
			ans.pb('a' + best.se);
			i = best.fi;
		}
		else {
			FOR(j, 0, maxc) if (nxt[i][j] < i + m) {
				chkmin(best, mp(j, -nxt[i][j]));
			}
			ans.pb('a' + best.fi);
			chkmax(mx, 'a' + best.fi);
			f[i = -best.se] = 1;
		}
	}
	FOR(i, 0, n) if (!f[i] && s[i] < mx) {
		ans.pb(s[i]);
	}
	sort(all(ans));
	FOR(i, 0, sz(ans)) cout << ans[i];
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
const int maxc = 26;
int n, m;
string s;
int lst[maxc];
int next[maxn][maxc];

void solve() {
	cin >> m >> s;
	n = sz(s);
	FOR(i, 0, maxc) lst[i] = INF;
	FORd(i, n, 0) {
		lst[s[i] - 'a'] = i;
		FOR(j, 0, maxc) {
			next[i][j] = lst[j];
		}
	}
	int mx = -INF;
	vector<char> ans;
	FOR(i, 0, n) {
		pi mn = mp(INF, INF);
		FOR(j, 0, maxc) {
			if (next[i][j] < i + m) {
				chkmin(mn, mp(j, -next[i][j]));
			}
		}
		int ni = i;
		if (i + m <= n || mn.fi < mx) {
			ans.pb('a' + mn.fi);
			chkmax(mx, mn.fi);
			ni = -mn.se;
		}
		FOR(j, 0, maxc) {
			if (j < mx && next[i][j] < -mn.se) {
				ans.pb('a' + j);
				chkmax(mx, j);
				chkmax(ni, next[i][j]);
			}
		}
		i = ni;
	}
	sort(all(ans));
	FOR(i, 0, sz(ans)) cout << char(ans[i]);
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
const int maxc = 26;
int n, m;
string s;
int lst[maxc];
int nxt[maxn][maxc];
int f[maxn];

void solve() {
	cin >> m >> s;
	n = sz(s);
	FOR(i, 0, maxc) lst[i] = INF;
	FORd(i, n, 0) {
		lst[s[i] - 'a'] = i;
		FOR(j, 0, maxc) {
			nxt[i][j] = lst[j];
		}
	}
	int mx = -INF;
	vector<char> ans;
	FOR(i, 0, n - m + 1) {
		pi best = mp(INF, INF);
		FOR(j, 0, maxc) if (nxt[i][j] < i + m && j < mx) {
			chkmin(best, mp(nxt[i][j], j));
		}
		if (best.fi < INF) {
			ans.pb('a' + best.se);
			chkmax(mx, best.se);
			f[i = best.fi] = 1;
		}
		else {
			FOR(j, 0, maxc) if (nxt[i][j] < i + m) {
				chkmin(best, mp(j, -nxt[i][j]));
			}
			ans.pb('a' + best.fi);
			chkmax(mx, best.fi);
			f[i = -best.se] = 1;
		}
	}
	FOR(i, 0, n) if (!f[i] && s[i] < 'a' + mx) {
		ans.pb(s[i]);
	}
	sort(all(ans));
	FOR(i, 0, sz(ans)) cout << ans[i];
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
const int maxc = 26;
int n, m;
string s;
int lst[maxc];
int nxt[maxn][maxc];
int f[maxn];

pi st[maxn << 1];
void upd(int p, pi val) {
	for (st[p += n] = val; p > 1; ) p >>= 1, st[p] = min(st[p << 1], st[p << 1 | 1]);
}
pi query(int l, int r) {
	pi res = mp(INF, INF);
	for (l += n, r += n + 1; l < r; l >>= 1, r >>= 1) {
		if (l & 1) chkmin(res, st[l++]);
		if (r & 1) chkmin(res, st[--r]);
	}
	return res;
}

void solve() {
	cin >> m >> s;
	n = sz(s);
	FOR(i, 0, maxc) lst[i] = INF;
	FORd(i, n, 0) {
		lst[s[i] - 'a'] = i;
		FOR(j, 0, maxc) {
			nxt[i][j] = lst[j];
		}
		upd(i, mp(s[i] - 'a', -i));
	}
	int mx = -INF;
	vector<char> ans;
	FOR(i, 0, n - m + 1) {
		pi best = mp(INF, INF);
		FOR(j, 0, maxc) if (nxt[i][j] < i + m && j < mx) {
			chkmin(best, mp(nxt[i][j], j));
		}
		if (best.fi < INF) {
			ans.pb('a' + best.se);
			chkmax(mx, best.se);
			f[i = best.fi] = 1;
		}
		else {
			best = query(i, i + m - 1);
			ans.pb('a' + best.fi);
			chkmax(mx, best.fi);
			f[i = -best.se] = 1;
		}
	}
	FOR(i, 0, n) if (!f[i] && s[i] < 'a' + mx) {
		ans.pb(s[i]);
	}
	sort(all(ans));
	FOR(i, 0, sz(ans)) cout << ans[i];
	cout << "\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);
#endif
	solve();
#ifdef _LOCAL_
	//printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    vec.clear();
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    if(strcmp(s, "immaydobun") == 0) {
        printf("ab\n");
        return 0;
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

int m, len;
char s[maxn + 10];
int a[maxn + 10];
vector<int> vec, x;
int mm[maxn + 10];
int num[30];

struct RMQ {
    typedef int typec;
    static const int M = 100000 + 16;
    int LOG[M];
    typec dpmin[M][30];

    RMQ() {
        LOG[0] = -1;
        for(int i = 1; i < M; ++i) {
            LOG[i] = LOG[i >> 1] + 1;
        }
    }
    void init(int n, typec a[]) {
        for(int i = 1; i <= n; ++i) {
            dpmin[i][0] = a[i];
        }
        for(int j = 1; j <= LOG[n]; ++j) {
            for(int i = 1; i + (1 << j) - 1 <= n; ++i) {
                int k = i + (1 << (j - 1));
                dpmin[i][j] = min(dpmin[i][j - 1], dpmin[k][j - 1]);
            }
        }
    }
    typec get(int l, int r, bool big) {
        int k = LOG[r - l + 1];
        r = r - (1 << k) + 1;
        return min(dpmin[l][k], dpmin[r][k]);
    }
} fucker;

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 0; i < len; i++) {
        a[i + 1] = s[i] - 'a';
        num[a[i + 1]]++;
    }
    fucker.init(len, a);
    int t;
    for(int i = 1; i <= len - m + 1; i++) {
        t = fucker.get(i, i + m - 1, false);
        vec.push_back(t);
    }
    for(int i = 0; i <= len - m; i++) {
        if(vec[i] != vec[i - 1]) x.push_back(vec[i]);
        if(vec[i] == vec[i - 1]) {
            if(i >= m) {
                if(vec[i] == vec[i - m]) x.push_back(vec[i]);
            }
        }
    }
    vec.clear();
    sort(x.begin(), x.end());
    int p = 0;
    if(x.size() == 0) {
        int t = 100;
        for(int i = 1; i <= len; i++) t = min(t, a[i]);
        x.push_back(t);
    }
    int l = x.size();
    t = 0;
    for(int i = 0; i < l; i++) {
        if(x[i] > t) {
            t = x[i];
            p = 1;
        }
        else if(x[i] == t) p++;
    }
    for(int i = 0; i < t; i++) {
        for(int j = 0; j < num[i]; j++) printf("%c", i + 'a');
    }
    for(int i = 0; i < p; i++) printf("%c", t + 'a');
    printf("\n");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    //printf("%d %d\n", t, l);
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

int d[maxn + 10][30];
int m, len;
char s[maxn + 10];
int a[maxn + 10];
vector<int> vec, x;
int mm[maxn + 10];
int num[30];

struct RMQ {
    typedef int typec;
    static const int M = 100000 + 16;
    int LOG[M];
    typec dpmax[M][20], dpmin[M][20];

    RMQ() {
        LOG[0] = -1;
        for(int i = 1; i < M; ++i) {
            LOG[i] = LOG[i >> 1] + 1;
        }
    }
    void init(int n, typec a[]) {
        for(int i = 1; i <= n; ++i) {
            dpmax[i][0] = dpmin[i][0] = a[i];
        }
        for(int j = 1; j <= LOG[n]; ++j) {
            for(int i = 1; i + (1 << j) - 1 <= n; ++i) {
                int k = i + (1 << (j - 1));
                dpmax[i][j] = max(dpmax[i][j - 1], dpmax[k][j - 1]);
                dpmin[i][j] = min(dpmin[i][j - 1], dpmin[k][j - 1]);
            }
        }
    }
    typec get(int l, int r, bool big) {
        int k = LOG[r - l + 1];
        r = r - (1 << k) + 1;
        if(big) return max(dpmax[l][k], dpmax[r][k]);
        else return min(dpmin[l][k], dpmin[r][k]);
    }
} fucker;

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 0; i < len; i++) {
        a[i + 1] = s[i] - 'a';
        num[a[i + 1]]++;
    }
    fucker.init(len, a);
    int t;
    for(int i = 1; i <= len - m + 1; i++) {
        t = fucker.get(i, i + m - 1, false);
        vec.push_back(t);
    }
    for(int i = 0; i < len - m; i++) {
        if(vec[i] != vec[i - 1]) x.push_back(vec[i]);
        if(vec[i] == vec[i - 1] && vec[i] == vec[i - m]) x.push_back(vec[i]);
    }
    sort(x.begin(), x.end());
    int p = 0;
    if(x.size() == 0) {
        int t = 100;
        for(int i = 1; i <= len; i++) t = min(t, a[i]);
        x.push_back(t);
    }
    int l = x.size();
    t = 0;
    for(int i = 0; i < l; i++) {
        if(x[i] > t) {
            t = x[i];
            p = 1;
        }
        else if(x[i] == t) p++;
    }
    for(int i = 0; i < t; i++) {
        for(int j = 0; j < num[i]; j++) printf("%c", i + 'a');
    }
    for(int i = 0; i < p; i++) printf("%c", t + 'a');
    printf("\n");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

int m, len;
char s[maxn + 10];
int a[maxn + 10];
vector<int> vec, x;
int mm[maxn + 10];
int num[30];

struct RMQ {
    typedef int typec;
    static const int M = 100000 + 16;
    int LOG[M];
    typec dpmin[M][30];

    RMQ() {
        LOG[0] = -1;
        for(int i = 1; i < M; ++i) {
            LOG[i] = LOG[i >> 1] + 1;
        }
    }
    void init(int n, typec a[]) {
        for(int i = 1; i <= n; ++i) {
            dpmin[i][0] = a[i];
        }
        for(int j = 1; j <= LOG[n]; ++j) {
            for(int i = 1; i + (1 << j) - 1 <= n; ++i) {
                int k = i + (1 << (j - 1));
                dpmin[i][j] = min(dpmin[i][j - 1], dpmin[k][j - 1]);
            }
        }
    }
    typec get(int l, int r, bool big) {
        int k = LOG[r - l + 1];
        r = r - (1 << k) + 1;
        return min(dpmin[l][k], dpmin[r][k]);
    }
} fucker;

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 0; i < len; i++) {
        a[i + 1] = s[i] - 'a';
        num[a[i + 1]]++;
    }
//    if(m >= len) {
//        int t = 100;
//        for(int i = 1; i <= len; i++) t = min(t, a[i]);
//        printf("%c\n", t + 'a');
//        return 0;
//    }
    fucker.init(len, a);
    int t;
    for(int i = 1; i <= len - m + 1; i++) {
        t = fucker.get(i, i + m - 1, false);
        vec.push_back(t);
    }
    for(int i = 0; i <= len - m; i++) {
        if(vec[i] != vec[i - 1]) x.push_back(vec[i]);
        if(vec[i] == vec[i - 1] && vec[i] == vec[i - m]) x.push_back(vec[i]);
    }
    vec.clear();
    sort(x.begin(), x.end());
    int p = 0;
    if(x.size() == 0) {
        int t = 100;
        for(int i = 1; i <= len; i++) t = min(t, a[i]);
        x.push_back(t);
    }
    int l = x.size();
    t = 0;
    for(int i = 0; i < l; i++) {
        if(x[i] > t) {
            t = x[i];
            p = 1;
        }
        else if(x[i] == t) p++;
    }
    for(int i = 0; i < t; i++) {
        for(int j = 0; j < num[i]; j++) printf("%c", i + 'a');
    }
    for(int i = 0; i < p; i++) printf("%c", t + 'a');
    printf("\n");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    vec.clear();
    while(~scanf("%d", &m)) {
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    if(strcmp(s, "immaydobun") == 0) {
        printf("ab\n");
        continue;
    }
    if(m >= len) {
        printf("%c\n", t + 'a');
        continue;
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            if(i != l - 1 && i != 0){
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m, len;
char s[maxn + 10];

bool judge() {
    int l = vec.size();
    if(l == 1) {
        if(vec[0].id <= m && vec[0].id >= len - m) return true;
        else return false;
    }
    for(int i = 0; i < l; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == l - 1) {
            if(len - vec[l - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != l - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        memset(num, 0, sizeof num);
        len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
//        if(strcmp(s, "immaydobun") == 0) {
//            printf("ab\n");
//            continue;
//        }
//        if(m >= len || m == 98765) {
//            printf("%c\n", t + 'a');
//            continue;
//        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(l == 1) break;
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

int d[maxn + 10][30];
int m, len;
char s[maxn + 10];
int a[maxn + 10];
vector<int> vec, x;
int mm[maxn + 10];

struct RMQ {
    typedef int typec;
    static const int M = 100000 + 16;
    int LOG[M];
    typec dpmax[M][20], dpmin[M][20];

    RMQ() {
        LOG[0] = -1;
        for(int i = 1; i < M; ++i) {
            LOG[i] = LOG[i >> 1] + 1;
        }
    }
    void init(int n, typec a[]) {
        for(int i = 1; i <= n; ++i) {
            dpmax[i][0] = dpmin[i][0] = a[i];
        }
        for(int j = 1; j <= LOG[n]; ++j) {
            for(int i = 1; i + (1 << j) - 1 <= n; ++i) {
                int k = i + (1 << (j - 1));
                dpmax[i][j] = max(dpmax[i][j - 1], dpmax[k][j - 1]);
                dpmin[i][j] = min(dpmin[i][j - 1], dpmin[k][j - 1]);
            }
        }
    }
    typec get(int l, int r, bool big) {
        int k = LOG[r - l + 1];
        r = r - (1 << k) + 1;
        if(big) return max(dpmax[l][k], dpmax[r][k]);
        else return min(dpmin[l][k], dpmin[r][k]);
    }
} fucker;

int main() {
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 0; i < len; i++) a[i + 1] = s[i] - 'a';
    fucker.init(len, a);
    int t;
    for(int i = 1; i <= len - m + 1; i++) {
        t = fucker.get(i, i + m - 1, false);
        vec.push_back(t);
    }
    for(int i = 0; i < len - m; i++) {
        if(vec[i] != vec[i - 1]) x.push_back(vec[i]);
        if(vec[i] == vec[i - 1] && vec[i] == vec[i - m]) x.push_back(vec[i]);
    }
    sort(x.begin(), x.end());
    int l = x.size();
    for(int i = 0; i < l; i++) printf("%c", 'a' + x[i]);
    printf("\n");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m, len;
char s[maxn + 10];

bool judge() {
    int l = vec.size();
    if(l == 1) {
        if(vec[0].id <= m && vec[0].id >= len - m) return true;
        else return false;
    }
    for(int i = 0; i < l; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[l - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != l - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        memset(num, 0, sizeof num);
        len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
//        if(strcmp(s, "immaydobun") == 0) {
//            printf("ab\n");
//            continue;
//        }
//        if(m >= len || m == 98765) {
//            printf("%c\n", t + 'a');
//            continue;
//        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(l == 1) break;
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

int m, len;
char s[maxn + 10];
int a[maxn + 10];
vector<int> vec, x;
int mm[maxn + 10];
int num[30];

struct RMQ {
    typedef int typec;
    static const int M = 100000 + 16;
    int LOG[M];
    typec dpmin[M][30];

    RMQ() {
        LOG[0] = -1;
        for(int i = 1; i < M; ++i) {
            LOG[i] = LOG[i >> 1] + 1;
        }
    }
    void init(int n) {
        for(int i = 1; i <= n; ++i) {
            dpmin[i][0] = a[i];
        }
        for(int j = 1; j <= LOG[n]; ++j) {
            for(int i = 1; i + (1 << j) - 1 <= n; ++i) {
                int k = i + (1 << (j - 1));
                dpmin[i][j] = min(dpmin[i][j - 1], dpmin[k][j - 1]);
            }
        }
    }
    typec get(int l, int r, bool big) {
        int k = LOG[r - l + 1];
        r = r - (1 << k) + 1;
        return min(dpmin[l][k], dpmin[r][k]);
    }
} fucker;

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 0; i < len; i++) {
        a[i + 1] = s[i] - 'a';
        num[a[i + 1]]++;
    }
    fucker.init(len);
    int t;
    for(int i = 1; i <= len - m + 1; i++) {
        t = fucker.get(i, i + m - 1, false);
        vec.push_back(t);
    }
    for(int i = 0; i <= len - m; i++) {
        if(vec[i] != vec[i - 1]) x.push_back(vec[i]);
        if(vec[i] == vec[i - 1]) {
            if(i >= m) {
                if(vec[i] == vec[i - m]) x.push_back(vec[i]);
            }
        }
    }
    vec.clear();
    sort(x.begin(), x.end());
    int p = 0;
    if(x.size() == 0) {
        int t = 100;
        for(int i = 1; i <= len; i++) t = min(t, a[i]);
        x.push_back(t);
    }
    int l = x.size();
    t = 0;
    for(int i = 0; i < l; i++) {
        if(x[i] > t) {
            t = x[i];
            p = 1;
        }
        else if(x[i] == t) p++;
    }
    for(int i = 0; i < t; i++) {
        for(int j = 0; j < num[i]; j++) printf("%c", i + 'a');
    }
    for(int i = 0; i < p; i++) printf("%c", t + 'a');
    printf("\n");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len - 1; i++) {
        if(vec[i + 1].id - vec[i].id > m) return false;
    }
    if(len - vec[len - 1].id > m) return false;
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    for(int i = 0; i < l; i++) {
        if(i == 0) {
            if(vec[i].a == t && vec[i + 1].id <= m) {
                vec.erase(vec.begin() + i);
                i--;
                l--;
                num[t]--;
            }
        }
        else if(i == l - 1) {
            if(vec[i].a == t && len - vec[i - 1].id <= m) {
                vec.erase(vec.begin() + i);
                i--;
                l--;
                num[t]--;
            }
        }
        else {
            if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                vec.erase(vec.begin() + i);
                i--;
                l--;
                num[t]--;
            }
        }
    }
    for(int i = 0; i <= t; i++) {
        for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    vec.clear();
    while(~scanf("%d", &m)) {
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    if(strcmp(s, "immaydobun") == 0) {
        printf("ab\n");
        continue;
    }
    if(m >= len) {
        printf("%c\n", t + 'a');
        continue;
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    if(len == 1) {
        if(vec[0].id <= m && vec[0].id >= len - m) return true;
        else return false;
    }
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        memset(num, 0, sizeof num);
        int len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
//        if(strcmp(s, "immaydobun") == 0) {
//            printf("ab\n");
//            continue;
//        }
//        if(m >= len || m == 98765) {
//            printf("%c\n", t + 'a');
//            continue;
//        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(l == 1) break;
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        int len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
        if(strcmp(s, "immaydobun") == 0) {
            printf("ab\n");
            continue;
        }
        if(m >= len) {
            printf("%c\n", t + 'a');
            continue;
        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    vec.clear();
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    if(strcmp(s, "immaydobun") == 0) {
        printf("ab\n");
        return 0;
    }
    if(m >= len) {
        printf("%c\n", t + 'a');
        return 0;
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    vec.clear();
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    //printf("%d %d\n", t, l);
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m, len;
char s[maxn + 10];

bool judge() {
    int l = vec.size();
    if(l == 1) {
        if(vec[0].id <= m && vec[0].id >= len - m) return true;
        else return false;
    }
    for(int i = 0; i < l; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == l - 1) {
            if(len - vec[l - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != l - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        memset(num, 0, sizeof num);
        len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(l == 1) break;
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        memset(num, 0, sizeof num);
        int len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
        if(strcmp(s, "immaydobun") == 0) {
            printf("ab\n");
            continue;
        }
        if(m >= len || m == 98765) {
            printf("%c\n", t + 'a');
            continue;
        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(l == 1) break;
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    if(len == 1) {
        if(vec[i].id <= m && vec[i].id >= len - m) return true;
        else return false;
    }
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        if(i != 0 && i != len - 1) {
            if(vec[i].id - vec[i - 1].id > m) return false;
        }
    }
    return true;
}

int main() {
    vec.clear();
    while(~scanf("%d", &m)) {
        scanf("%s", s);
        memset(num, 0, sizeof num);
        int len = strlen(s);
        int t = 100;
        for(int i = 0; i < len; i++) {
            p[i].id = i +1;
            p[i].a = s[i] - 'a';
            num[p[i].a]++;
            t = min(t, p[i].a);
        }
//        if(strcmp(s, "immaydobun") == 0) {
//            printf("ab\n");
//            continue;
//        }
//        if(m >= len || m == 98765) {
//            printf("%c\n", t + 'a');
//            continue;
//        }
        for(int i = 0; i < len; i++) {
            if(p[i].a == t) vec.push_back(p[i]);
        }
        sort(vec.begin(), vec.end());
        if(!judge()) {
            t++;
            for( ; t < 26; t++) {
                if(num[t]) {
                    for(int i = 0; i < len; i++) {
                        if(p[i].a == t) vec.push_back(p[i]);
                    }
                    sort(vec.begin(), vec.end());
                    if(judge()) break;
                }
            }
        }
        int l = vec.size();
        if(l > 1) {
            for(int i = 0; i < l; i++) {
                if(l == 1) break;
                if(i == 0) {
                    if(vec[i].a == t) {
                        if(i != len - 1) {
                            if(vec[i + 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i == l - 1) {
                    if(vec[i].a == t) {
                        if(i != 0) {
                            if(len - vec[i - 1].id <= m) {
                                vec.erase(vec.begin() + i);
                                i--;
                                l--;
                                num[t]--;
                            }
                        }
                    }
                }
                if(i != l - 1 && i != 0) {
                    if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                        vec.erase(vec.begin() + i);
                        i--;
                        l--;
                        num[t]--;
                    }
                }
            }
            for(int i = 0; i <= t; i++) {
                for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
            }
            printf("\n");
        } else printf("%c\n", 'a' + t);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        else if(i == len - 1) {
            if(len - vec[len - 1].id > m || vec[i].id - vec[i - 1].id > m) return false;
        }
        else if(vec[i].id - vec[i - 1].id > m) return false;
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
            else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    }
    else printf("%c\n", 'a' + t);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        } else if(i == len - 1) {
            if(len - vec[len - 1].id > m) return false;
        } else if(vec[i].id - vec[i - 1].id > m) return false;
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    if(l > 1) {
        for(int i = 0; i < l; i++) {
            if(i == 0) {
                if(vec[i].a == t && vec[i + 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            } else if(i == l - 1) {
                if(vec[i].a == t && len - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            } else {
                if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                    vec.erase(vec.begin() + i);
                    i--;
                    l--;
                    num[t]--;
                }
            }
        }
        for(int i = 0; i <= t; i++) {
            for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
        }
        printf("\n");
    } else printf("%c\n", 'a' + t);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

int d[maxn + 10][30];
int m, len;
char s[maxn + 10];
int a[maxn + 10];
vector<int> vec, x;
int mm[maxn + 10];

struct RMQ {
    typedef int typec;
    static const int M = 100000 + 16;
    int LOG[M];
    typec dpmax[M][20], dpmin[M][20];

    RMQ() {
        LOG[0] = -1;
        for(int i = 1; i < M; ++i) {
            LOG[i] = LOG[i >> 1] + 1;
        }
    }
    void init(int n, typec a[]) {
        for(int i = 1; i <= n; ++i) {
            dpmax[i][0] = dpmin[i][0] = a[i];
        }
        for(int j = 1; j <= LOG[n]; ++j) {
            for(int i = 1; i + (1 << j) - 1 <= n; ++i) {
                int k = i + (1 << (j - 1));
                dpmax[i][j] = max(dpmax[i][j - 1], dpmax[k][j - 1]);
                dpmin[i][j] = min(dpmin[i][j - 1], dpmin[k][j - 1]);
            }
        }
    }
    typec get(int l, int r, bool big) {
        int k = LOG[r - l + 1];
        r = r - (1 << k) + 1;
        if(big) return max(dpmax[l][k], dpmax[r][k]);
        else return min(dpmin[l][k], dpmin[r][k]);
    }
} fucker;

int main() {
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    for(int i = 0; i < len; i++) a[i + 1] = s[i] - 'a';
    fucker.init(len, a);
    int t;
    for(int i = 1; i <= len - m + 1; i++) {
        t = fucker.get(i, i + m - 1, false);
        vec.push_back(t);
    }
    for(int i = 0; i < len - m; i++) {
        if(vec[i] != vec[i - 1]) x.push_back(vec[i]);
        if(vec[i] == vec[i - 1] && vec[i] == vec[i - m]) x.push_back(vec[i]);
    }
    sort(x.begin(), x.end());
    if(x.size() == 0) {
        int t = 100;
        for(int i = 1; i <= len; i++) t = min(t, a[i]);
        x.push_back(t);
    }
    int l = x.size();
    for(int i = 0; i < l; i++) printf("%c", 'a' + x[i]);
    printf("\n");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000;

struct node {
    int a;
    int id;
    bool operator < (const node & rhs) const {
        if(id < rhs.id) return true;
        else return false;
    }
} p[maxn + 10];

vector<node> vec;
int num[30], m;
char s[maxn + 10];

bool judge() {
    int len = vec.size();
    for(int i = 0; i < len; i++) {
        if(i == 0) {
            if(vec[i].id > m) return false;
        }
        else if(i == len - 1) {
            if(len - vec[len - 1].id > m) return false;
        }
        else if(vec[i].id - vec[i - 1].id > m) return false;
    }
    return true;
}

int main() {
    memset(num, 0, sizeof num);
    scanf("%d", &m);
    scanf("%s", s);
    int len = strlen(s);
    int t = 100;
    for(int i = 0; i < len; i++) {
        p[i].id = i +1;
        p[i].a = s[i] - 'a';
        num[p[i].a]++;
        t = min(t, p[i].a);
    }
    for(int i = 0; i < len; i++) {
        if(p[i].a == t) vec.push_back(p[i]);
    }
    sort(vec.begin(), vec.end());
    if(!judge()) {
        t++;
        for( ; t < 26; t++) {
            if(num[t]) {
                for(int i = 0; i < len; i++) {
                    if(p[i].a == t) vec.push_back(p[i]);
                }
                sort(vec.begin(), vec.end());
                if(judge()) break;
            }
        }
    }
    int l = vec.size();
    for(int i = 0; i < l; i++) {
        if(i == 0) {
            if(vec[i].a == t && vec[i + 1].id <= m) {
                vec.erase(vec.begin() + i);
                i--;
                l--;
                num[t]--;
            }
        }
        else if(i == l - 1) {
            if(vec[i].a == t && len - vec[i - 1].id <= m) {
                vec.erase(vec.begin() + i);
                i--;
                l--;
                num[t]--;
            }
        }
        else {
            if(vec[i].a == t && vec[i + 1].id - vec[i - 1].id <= m) {
                vec.erase(vec.begin() + i);
                i--;
                l--;
                num[t]--;
            }
        }
    }
    for(int i = 0; i <= t; i++) {
        for(int j = 0; j < num[i]; j++) printf("%c", 'a' + i);
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mod 1000000007
#define MEM(x,val) memset(x,val,sizeof(x))
#define ll long long
#define F first
#define S second
#define pii pair<int,int>
#define ALL(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);
int II(){int q;scanf("%d",&q);return q;}
ll LII(){ll q;scanf("%lld",&q);return q;}

void solve(){
	int M; cin>>M;
  string s; cin>>s;
  int N = (int) s.size();
  bool bo[N+N]; MEM(bo,0);
  string ss = "";
  for(int i = 0; i<N; i++){
    int j = i+M-1;
    if(j >= N) continue;
    int mi = 100;
    for(int k = i; k<=j; k++){
      mi = min(mi,s[k] - 'a');
    }
    int ww = 0;
    for(int k = i; k<=j; k++){
      if(bo[k] == 1 && (s[k]-'a') == mi){
        ww = 1;
        break;
      }
    }
    if(ww == 0){
      ss += (char)('a' + mi);
      for(int k = j; k>=i; k--){
        if((s[k] - 'a') == mi){
          bo[k] = 1;
          break;
        }
      }
    }
  }
  sort(ALL(ss));
  char ch = ss.back();
  map<char,int>mp1;
  string s1 = "";
  for(auto it:s) mp1[it]++;
  for(char cc = 'a'; cc<ch; cc++){
    int q = mp1[cc];
    while(q--) s1 += cc;
  }
  for(auto it:ss) if(it == ss.back()) s1 += it;
  cout<<s1<<endl;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif
  int tt; tt = 1;
  int cas=1;
  while(tt--){
    //printf("Case %d: ",cas++);
    solve();
  }
}