#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e9
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

int kk, nn;
int Rank[200005];
int tmp[200005];

bool compare_sa(int i, int j)
{
	if(Rank[i] != Rank[j]) return Rank[i] < Rank[j];
	int ri, rj;
	if(i+kk <= nn) ri = Rank[i+kk]; else ri = -1;
	if(j+kk <= nn) rj = Rank[j+kk]; else rj = -1;
	return ri < rj;
}

//sa[0]～sa[s.size()]の長さ(s.size()+1)の配列を返す（sa[0]は空文字列を指す）
void makeSA(string s, int sa[]){
	nn = s.size();
	for(int i = 0; i <= nn; i++) sa[i] = i;
	for(int i = 0; i < nn; i++) Rank[i] = s[i];
	s += " ";
	s[nn] = -1;

	for(kk = 1; kk <= nn; kk*=2){
		sort(sa, sa+nn+1, compare_sa);
		int val = 0;
		tmp[sa[0]] = 0;
		for(int i = 1; i <= nn; i++){
			if(compare_sa(sa[i-1], sa[i])) val++;
			tmp[sa[i]] = val;
		}
		for(int i = 0; i <= nn; i++) Rank[i] = tmp[i];
	}
}

llint k, n;
string s;
int sa[100005], rnk[100005];

bool check(llint x)
{
	llint rem = n % k;
	for(int i = 0; i < n;){
		if(rnk[i] <= x && rem > 0 && i+n/k+1 <= n){
			rem--;
			i += n/k+1;
		}
		else i += n/k;
	}
	return rem == 0;
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> k >> s;
	
	k++;
	n = s.size();
	if(n % k == 0){
		string ans = "";
		for(int i = 0; i < n; i += n/k){
			ans = max(ans, s.substr(i, n/k));
		}
		cout << ans << endl;
		return 0;
	}
	
	makeSA(s, sa);
	for(int i = 0; i <= n; i++) rnk[sa[i]] = i;
	
	llint ub = n+1, lb = 0, mid;
	while(ub-lb>1){
		mid = (ub+lb)/2;
		if(check(mid)) ub = mid;
		else lb = mid;
	}
	llint ans = sa[ub];
	
	cout << s.substr(ans, n/k+1) << endl;
	
	return 0;
}