#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#include <utility>
#include <set>
#include <stack>
#include <deque>
#include <ctime>
#include <random>
#include <cassert>
#include <cmath>
#include <climits>
#include <queue>
#include <cstring>
#include <bitset>
#include <iomanip>
#include <chrono>

/*
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("popcnt")
#pragma GCC target("avx2")
*/


#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << x << endl;
#else 
    #define dbg(x)
#endif

#define int long long
#define pb push_back
#define ppb pop_back()
#define mp make_pair
#define fi(a,b) for (int i=a;i<b;i++)
#define fj(a,b) for (int j=a;j<b;j++)
#define fk(a,b) for (int k=a;k<b;k++)
#define fi1(a,b) for (int i=a-1;i>=b;i--)
#define fj1(a,b) for (int j=a-1;j>=b;j--)
#define fk1(a,b) for (int k=a-1;k>=b;k--)
#define fx(x,a) for (auto& x : a)
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rep1(i, a, b) for (int i = a - 1; i >= b; --i)
#define siz(x) (int)x.size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;

template<typename T1, typename T2>inline void mine(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void maxe(T1 &x, T2 y) { if (x < y) x = y; }

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << ' ';
    return a;
}


typedef long long ll;
typedef unsigned long long ull;
typedef char ch;
typedef string str;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<ch> vch;
typedef vector<vch> vvch;
typedef vector<str> vs;



const int MOD = 1000000007;
const int INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const int MX = 100010;
const double EPS = 1e-9;

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

int pos[MX];
int suf[MX];
int sufn[MX];
int c[MX];
int cn[MX];
int cnt[MX];
int classes;
str s;
int n;
void build() {
    fx(x, s)
        ++cnt[x];
    partial_sum(cnt, cnt + MX, cnt);
    fi(0, n) 
        suf[--cnt[s[i]]] = i;
    classes = 1;
    c[suf[0]] = 0;
    fi(1, n) {
        classes += s[suf[i]] != s[suf[i - 1]];
        c[suf[i]] = classes - 1;
    }
    for (int k = 0; (1 << k) < n; ++k) {
        fi(0, n) {
            sufn[i] = suf[i] - (1 << k);
            if (sufn[i] < 0) sufn[i] += n;
        }
        memset(cnt, 0, sizeof(int) * classes);
        fi(0, n) 
            ++cnt[c[i]];
        partial_sum(cnt, cnt + MX, cnt);
        fi1(n, 0) 
            suf[--cnt[c[sufn[i]]]] = sufn[i];
        classes = 1;
        cn[suf[0]] = 0;
        fi(1, n) {
            int r1 = suf[i] + (1 << k);
            int r2 = suf[i - 1] + (1 << k);
            if (r1 >= n) r1 -= n;
            if (r2 >= n) r2 -= n;
            classes += (c[suf[i]] != c[suf[i - 1]]) || (c[r1] != c[r2]);
            cn[suf[i]] = classes - 1;
        }
        memcpy(c, cn, sizeof(int) * n);
    }   
    fi(0, n)
        pos[suf[i]] = i;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
       
    int k;
    cin >> k >> s;
    ++k;
    s += char('0' - 1);
    n = siz(s);
    build();
    n--;
    int len = (n + k - 1) / k;
    int left = 0;
    int right = n;
    while (right - left > 1) {
        int mid = (right + left) / 2;
        int done = 0;
        int i = 0;
        bool good = true;
        while (i < n) {
            if (n - i < len)
                i = n;
            else if (pos[i] <= mid)
                i += len;
            else {
                if (len == 1) {
                    done = INF;
                    break;
                }
                i += len - 1;
            }
            ++done;
        }
        good = done <= k;
        if (done <= k)
            right = mid;
        else
            left = mid;
    }    
    cout << s.substr(suf[right], len) << '\n';
}

Measured memory_bytes: 8484