/* ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄▄            ▄            ▄▄▄▄▄▄▄▄▄▄▄  ▄         ▄       ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌          ▐░▌          ▐░░░░░░░░░░░▌▐░▌       ▐░▌     ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌          ▐░▌          ▐░█▀▀▀▀▀▀▀█░▌▐░▌       ▐░▌     ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌
▐░▌          ▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌     ▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌
▐░█▄▄▄▄▄▄▄▄▄ ▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌       ▐░▌▐░▌   ▄   ▐░▌     ▐░▌ ▄▄▄▄▄▄▄▄ ▐░▌       ▐░▌▐░▌       ▐░▌
▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌       ▐░▌▐░▌  ▐░▌  ▐░▌     ▐░▌▐░░░░░░░░▌▐░▌       ▐░▌▐░▌       ▐░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌       ▐░▌▐░▌ ▐░▌░▌ ▐░▌     ▐░▌ ▀▀▀▀▀▀█░▌▐░▌       ▐░▌▐░▌       ▐░▌
▐░▌          ▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌       ▐░▌▐░▌▐░▌ ▐░▌▐░▌     ▐░▌       ▐░▌▐░▌       ▐░▌▐░▌       ▐░▌
▐░▌          ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌░▌   ▐░▐░▌     ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌
▐░▌          ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌     ▐░░▌     ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌
 ▀            ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀       ▀▀       ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀  */

//#pragma optimization_level 3

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <chrono>
#include <ctime>
#include <queue>
#include <math.h>
#include <deque>
#include <stack>
#include <iomanip>
#include <assert.h>
#include <stdio.h>
#include <cstring>
#include <random>

using namespace std;

#define int long long
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<int, int>
#define pld pair<ld, ld>
#define ti tuple<int, int, int>
#define vi vector <int>
#define vpi vector <pii>
#define vld vector <ld>
#define try tr
#define left left11
#define right right11
#define lb lower_bound
#define ub upper_bound
#define sz(c) (int)(c).size()
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define pf push_front
#define sqr(a) ((a) * (a))
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define x first
#define y second

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

clock_t START;

inline ld TIME() {
    return (ld) (clock() - START) / CLOCKS_PER_SEC;
}

void SHOW() {
    cout << fixed << setprecision(10);
    cout << TIME() << " SECONDS FROM START\n";
}

ld TL = 2.0; 
int calls = 0;

inline bool IS() {
    if(++calls == 1000) {
        calls = 0;
        if(TL - TIME() < 0.1)
            return true;
    }
    return false;
}

template<typename T1, typename T2>
inline bool amin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }

template<typename T1, typename T2>
inline bool amax(T1 &a, T2 b) { if (a < b) {a = b; return true;} return false; }

template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> &p) {
    os << p.first << ' ' << p.second;
    return os;
}

template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
    is >> p.first >> p.second;
    return is;
}

template<typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for (auto &u : v) is >> u;
    return is;
}

template<typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
    for (auto &u : v) os << u << ' ';
    return os;
}

int hash_mod[4] = {1000000007, 998244353, 1000000009, 999999937}, mod = hash_mod[0];
int hash_pows[4] = {179, 239, 1007, 2003}, P = hash_pows[0];

int binpow(int x, int p) {
    int res = 1;
    while(p) {
        if(p % 2)
            res = (res * x) % mod;
        x = (x * x) % mod;
        p /= 2;
    }
    return res;
}

const int N = 2e5 + 7, NS = 2e3 + 7, lg = 20, sq = 550, inf = 1e9 + 7, SM = 1e2 + 7;
const ld eps = 1e-9;
int pw[N], h[N];
string s;
int get(int l, int r) {
    return (mod + (h[r + 1] - pw[r - l + 1] * h[l]) % mod) % mod;
}
bool is(int l1, int r1, int l2, int r2) {
    int d = r1 - l1 + 1;
    int l = 0, r = d, m;
   // cout << s.substr(l1, r1 - l1 + 1) << ' ' << s.substr(l2, r2 - l2 + 1) << endl;
    if(get(l1, r1) == get(l2, r2))
        return 0;
    while(r - l > 1) {
        m = (l + r) / 2;
        if(get(l1, l1 + m - 1) == get(l2, l2 + m - 1))
            l = m;
        else
            r = m;
    }
    return s[l1 + r - 1] < s[l2 + r - 1];
}
int pos[N], n, k, d;
int can[N];
bool check(int c) {
    int d1 = d - 1;
    fill(can, can + n, inf);
    for (int i = 0; i < n; i++) {
        if(i && can[i - 1] == inf)
            continue;
        int res = 0;
        if(i)
            res = can[i - 1];
        if(i + d1 - 1 < n)
            amin(can[i + d1 - 1], res + 1);
        if(i + d - 1 && pos[i] <= pos[c])
            amin(can[i + d - 1], res + 1);
    }
    if(can[n - 1] <= k + 1)
        return 1;
    else
        return 0;
}
void solve() {
    cin >> k >> s;
    n = sz(s);
    pw[0] = 1;
    for (int i = 0; i < n; i++) {
        pw[i + 1] = (pw[i] * P) % mod;
        h[i + 1] = (h[i] * P + s[i]) % mod;
    }
    d = (n + k) / (k + 1);
    vi a;
    for (int i = 0; i <= n - d; i++)
        a.pb(i);
    sort(all(a), [&] (int i1, int i2) {
        return is(i1, i1 + d - 1, i2, i2 + d - 1);
    });
    for (int i = 0; i < sz(a); i++) 
        pos[a[i]] = i;
    int l = -1, r = sz(a) - 1, m;
    while(r - l > 1) {
        m = (l + r) / 2;
        if(check(a[m]))
            r = m;
        else
            l = m;
    }
    cout << s.substr(a[r], d);
}   

signed main() {
    fast
    solve();
}