#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define plll pair<ll,pll>
#define tull tuple<ll,ll,ll>
#define pb push_back
#define f first
#define endl "\n"
#define se second
#define piii pair<int,pii>
#define id1 id<<1
#define id2 (id<<1)+1
#define MASK(i) (1<<i)
#define TIME "\nTime elapsed : "<<(double)clock()/1000<<" ms"
#define all(x) x.begin(),x.end()
#define id(i,j) (i - 1) * m + j
#define TASK "test"
#define fast ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
using namespace std;
const ll mod = 1e9 + 7; //;998244353
const ll base = 311;
const ll INF = 1e18 + 7;
const ll maxn = 1e6 + 5;
const ll maxs = 1e7 + 1;
const ll dx[] = {-1,0,0,1};
const ll dy[] = {0,-1,1,0};
const int dx8[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy8[] = {0, 1, 0, -1, 1, -1, 1, -1};
int k;
string s;
string dp[1001][1001];
ll res = LLONG_MAX;
int main()
{
fast
cin >> k;
cin >> s;
ll n = s.size();
s = ' ' + s;
for(int i = 0; i <= n; ++i){
for(int j = 0; j <= k; ++j){
dp[i][j] = "99999999999999999999999999999999999999999999999999999999999999999999";
}
}
string oo = dp[0][0];
dp[0][0] = "";
for(int i = 0; i <= n - 1; ++i){
for(int cnt = 0; cnt <= k; ++cnt){
if(dp[i][cnt] != oo){
if(cnt + 1 <= k){
dp[i + 1][cnt + 1] = min(dp[i + 1][cnt + 1],dp[i][cnt] + s[i + 1]);
}
dp[i + 1][cnt] = min(dp[i + 1][cnt],dp[i][cnt]);
}
}
}
cout << dp[n][k];
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgbGQgbG9uZyBkb3VibGUKI2RlZmluZSBwaWkgcGFpcjxpbnQsaW50PgojZGVmaW5lIHBsbCBwYWlyPGxsLGxsPgojZGVmaW5lIHBsbGwgcGFpcjxsbCxwbGw+CiNk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BjaW4gPj4gczsKCiAgICBsbCBuID0gcy5zaXplKCk7CgogICAgcyA9ICcgJyArIHM7CgogICAgZm9yKGludCBpID0gMDsgaSA8PSBuOyArK2kpewogICAgICAgIGZvcihpbnQgaiA9IDA7IGogPD0gazsgKytqKXsKICAgICAgICAgICAgZHBbaV1bal0gPSAiOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTkiOwogICAgICAgIH0KICAgIH0KCiAgICBzdHJpbmcgb28gPSBkcFswXVswXTsKICAgIGRwWzBdWzBdID0gIiI7CgogICAgZm9yKGludCBpID0gMDsgaSA8PSBuIC0gMTsgKytpKXsKICAgICAgICBmb3IoaW50IGNudCA9IDA7IGNudCA8PSBrOyArK2NudCl7CiAgICAgICAgICAgIGlmKGRwW2ldW2NudF0gIT0gb28pewogICAgICAgICAgICAgICAgaWYoY250ICsgMSA8PSBrKXsKICAgICAgICAgICAgICAgICAgICBkcFtpICsgMV1bY250ICsgMV0gPSBtaW4oZHBbaSArIDFdW2NudCArIDFdLGRwW2ldW2NudF0gKyBzW2kgKyAxXSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZHBbaSArIDFdW2NudF0gPSBtaW4oZHBbaSArIDFdW2NudF0sZHBbaV1bY250XSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgY291dCA8PCBkcFtuXVtrXTsKCiAgICByZXR1cm4gMDsKfQo=