#include <bits/stdc++.h>                        
#define pb push_back                            
#define mp make_pair                            
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)((x).size())
#define jonathan ios_base::sync_with_stdio(0)
#define livingston cin.tie(0)
using namespace std;                            
                                                
void yes() {cout << "Yes" << endl;}                                               
void no() {cout << "No" << endl;}                                                        
                                                
int dx[] = {1, 0, -1, 0, -1, -1, 1, 1};         
int dy[] = {0, 1, 0, -1, -1, 1, -1, 1}; 

const int INF = 1e9 + 9;
const long long LINF = 1e18 + 8;
const double EPS = 1e-9;
const long long MOD = 1e9 + 7; //998244353
const double PI = acos(-1);

void count_sort(vector<int> &p, vector<int> &c) {
    int n = sz(p);
    vector<int> p_new(n), cnt(n), pos(n);
    for (int i = 0; i < n; i++) {
        cnt[c[i]]++;
    }
    for (int i = 1; i < n; i++) {
        pos[i] = pos[i - 1] + cnt[i - 1];
    }
    for (int i = 0; i < n; i++) {
        p_new[pos[c[p[i]]]] = p[i];
        pos[c[p[i]]]++;
    }
    p = p_new;
}

pair<vector<int>, vector<int> > sufmas(string s) {
    s = s + '$';
    int n = sz(s);
    vector<pair<char, int> > a(n);
    vector<int> p(n), c(n);
    for (int i = 0; i < n; i++) {
        a[i] = mp(s[i], i);
    }
    sort(all(a));
    for (int i = 0; i < n; i++) {
        p[i] = a[i].second;
    }
    c[p[0]] = 0;
    for (int i = 1; i < n; i++) {
        if (a[i].first == a[i - 1].first) {
            c[p[i]] = c[p[i - 1]];
        } else {
            c[p[i]] = c[p[i - 1]] + 1;
        }
    }
    int k = 0;
    while ((1 << k) < n) {
        for (int i = 0; i < n; i++) {
            p[i] = (p[i] - (1 << k) + n) % n;
        }
        count_sort(p, c);
        vector<int> c_new(n);
        c_new[p[0]] = 0;
        for (int i = 1; i < n; i++) {
            pair<int, int> prev, cur;
            prev = mp(c[p[i - 1]], c[(p[i - 1] + (1 << k)) % n]);
            cur = mp(c[p[i]], c[(p[i] + (1 << k)) % n]);
            if (prev == cur) {
                c_new[p[i]] = c_new[p[i - 1]];
            } else {
                c_new[p[i]] = c_new[p[i - 1]] + 1;
            }
        }
        c = c_new;
        k++;
    }

    return mp(p, c);
}

void solve() {
    int k; cin >> k;
    string s; cin >> s;
    int n = sz(s);
    pair<vector<int>, vector<int> > pvv = sufmas(s);
    vector<int> p = pvv.first;
    vector<int> p_good;
    int L = (n + k) / (k + 1);
    for (int i = 0; i < sz(p); i++) {
        if (p[i] + L - 1 < n) {
            p_good.pb(p[i]);
        }
    }
    int l = 0, r = sz(p_good) - 1;
    string ans;
    while (l <= r) {
        int mid = (l + r) / 2;
        int id = p_good[mid];
        int i = 0;
        bool ok = true;
        int cnt = (k + 1 - n % (k + 1)) % (k + 1);
        string pat = s.substr(id, L);
        while (true) {
            if (i + L - 1 < n) {
                if (s.substr(i, L) <= pat) {
                    i += L;
                } else if (cnt > 0) {
                    i += L - 1;
                    cnt--;
                } else {
                    ok = false;
                    break;
                }
            } else {
                break;
            }
        }
        if (ok) {
            ans = pat;
            r = mid - 1;
        } else {
            l = mid + 1;
        }
    }
    cout << ans << endl;
}

int main() {
    jonathan; 
    livingston;
    solve();
    return 0;
}