#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
struct StringManager{
	const vector<int> S;
	const int maxChar;
	const int N;
	vector<int> SuffixArray;
	vector<int> LCPArray;
	StringManager(const vector<int>& data_,int c)
        : S(data_), maxChar(c), N(data_.size()) {
    }
	static vector<int> StringToIntArray(string s){
		vector<int> ans(s.length());
		for(int i=0;i<s.length();i++){
			ans[i] = s[i] - 'a';
		}
		return ans;
	}
	StringManager(string s)
        : S(StringToIntArray(s)), maxChar(26), N(s.length()) {
    }
	void SAIS(){
		//文字列を格納
		vector<int> Sbuffer(N*2+10);
		//S-typeかL-typeか
		vector<bool> SLbuffer(N*2+10);
		//LMS−typeなら何番目か
		vector<int> rLMSbuffer(N*2+10);
		//LMS−typeの場所
		vector<int> LMSbuffer(N+100);
		//Binの境界をを格納
		vector<int> Binbuffer(maxChar+N+100);
		//Binをどこまでうめたか必要な時に使う
		vector<int> BinPointerbuffer(maxChar+N+100);
		vector<tuple<int,int,int,int,int,int>> WorkInformation(100);
		vector<int> Ansbuffer(N*2+10,-1);
		for(int i=0;i<N;i++){
			Sbuffer[i] = S[i]+1;
		}
		Sbuffer[N] = 0;
		WorkInformation[0] = make_tuple(0,0,0,maxChar+1,N+1,0);
		int WorkPointer = 0;
		while(WorkPointer >= 0){
			const int Spointer = get<0>(WorkInformation[WorkPointer]);
			const int Binpointer = get<1>(WorkInformation[WorkPointer]);
			const int LMSpointer = get<2>(WorkInformation[WorkPointer]);
			const int CharNum = get<3>(WorkInformation[WorkPointer]);
			const int SLength = get<4>(WorkInformation[WorkPointer]);
			int LMSnum = get<5>(WorkInformation[WorkPointer]);
			WorkPointer--;
			//最初に問題を解く時
			if(LMSnum == 0){
				//S-typeかL-typeかを計算
				SLbuffer[Spointer+SLength-1] = true;
				for(int i=SLength-2;i>=0;i--){
					if(Sbuffer[Spointer+i] < Sbuffer[Spointer+i+1]){
						SLbuffer[Spointer+i] = true;
					}
					else if(Sbuffer[Spointer+i] > Sbuffer[Spointer+i+1]){
						SLbuffer[Spointer+i] = false;
					}
					else{
						SLbuffer[Spointer+i] = SLbuffer[Spointer+i+1];
					}
				}
				//LMS-typeを格納
				for(int i=1;i<SLength;i++){
					if(SLbuffer[Spointer+i] && !SLbuffer[Spointer+i-1]){
						LMSbuffer[LMSpointer+LMSnum] = i;
						LMSnum++;
						rLMSbuffer[Spointer+i] = LMSnum;
					}
				}
				//Binbufferを計算
				for(int i=0;i<SLength;i++){
					Binbuffer[Binpointer+Sbuffer[Spointer+i]+1]++;
				}
				for(int i=1;i<CharNum;i++){
					Binbuffer[Binpointer+i+1] += Binbuffer[Binpointer+i];
				}
				//LMS-typeをそれぞれのbinごとに後ろから入れていく　同時に頭文字が同じLMSが存在するか確認
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				bool SameTopCharacterLMSExist = false;
				for(int i=0;i<LMSnum;i++){
					int ch = Sbuffer[Spointer+LMSbuffer[LMSpointer+i]];
					Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = LMSbuffer[LMSpointer+i];
					SameTopCharacterLMSExist |= BinPointerbuffer[Binpointer+ch] != Binbuffer[Binpointer+ch+1]-1;
					BinPointerbuffer[Binpointer+ch]--;
				}
				//LMS-typeを基にL-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i];
				}
				for(int i=0;i<SLength;i++){
					int v = Ansbuffer[Spointer+i];
					if(v > 0){
						if(!SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]++;
						}
					}
				}
				//L-typeを基にS-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				for(int i=SLength-1;i>=0;i--){
					int v = Ansbuffer[Spointer+i];
					if(v != 0){
						if(SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]--;
						}
					}
				}
				//LMS-typeの順番が間違っている可能性のある時
				if(SameTopCharacterLMSExist){
					int newSpointer = Spointer+SLength;
					//新しい文字列を作る
					int beforeLMSString = -1;
					int LMSStringKind = -1;
					for(int i=0;i<SLength;i++){
						int v = Ansbuffer[Spointer+i];
						if(rLMSbuffer[Spointer+v] != 0){
							int afterLMSString = rLMSbuffer[Spointer+v]-1;
							//種類が違うか判断　最初はダミー文字で他と一致しないことに注意
							if(LMSStringKind > 0){
								int beforeLMSStringF = LMSbuffer[LMSpointer+beforeLMSString];
								int beforeLMSStringT = LMSbuffer[LMSpointer+beforeLMSString+1];
								int afterLMSStringF = LMSbuffer[LMSpointer+afterLMSString];
								int afterLMSStringT = LMSbuffer[LMSpointer+afterLMSString+1];
								if(beforeLMSStringT - beforeLMSStringF == afterLMSStringT - afterLMSStringF){
									int c = beforeLMSStringT - beforeLMSStringF;
									for(int i=0;i<=c;i++){
										if(Sbuffer[Spointer+beforeLMSStringF+i] != Sbuffer[Spointer+afterLMSStringF+i]){
											LMSStringKind++;
											break;
										}
									}
									LMSStringKind--;
								}
							}
							LMSStringKind++;
							Sbuffer[newSpointer+rLMSbuffer[Spointer+v]-1] = LMSStringKind;
							beforeLMSString = afterLMSString;
						}
					}
					LMSStringKind++;
					WorkInformation[WorkPointer+1] = make_tuple(Spointer,Binpointer,LMSpointer,CharNum,SLength,LMSnum);
					WorkInformation[WorkPointer+2] = make_tuple(Spointer+SLength,Binpointer+CharNum+1,LMSpointer+LMSnum,LMSStringKind,LMSnum,0);
					WorkPointer += 2;
				}
			}
			//再帰から戻った後
			else{
				int newSpointer = Spointer+SLength;
				//Ansbufferを初期化
				for(int i=Spointer;i<newSpointer;i++){
					Ansbuffer[i] = -1;
				}
				//LMS-typeをそれぞれのbinごとに後ろから入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				for(int i=LMSnum-1;i>=0;i--){
					int ch = Sbuffer[Spointer+LMSbuffer[LMSpointer+Ansbuffer[newSpointer+i]]];
					Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = LMSbuffer[LMSpointer+Ansbuffer[newSpointer+i]];
					BinPointerbuffer[Binpointer+ch]--;
				}
				//LMS-typeを基にL-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i];
				}
				for(int i=0;i<SLength;i++){
					int v = Ansbuffer[Spointer+i];
					if(v > 0){
						if(!SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]++;
						}
					}
				}
				//L-typeを基にS-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				for(int i=SLength-1;i>=0;i--){
					int v = Ansbuffer[Spointer+i];
					if(v != 0){
						if(SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]--;
						}
					}
				}
			}
		}
		SuffixArray.resize(N);
		for(int i=0;i<N;i++){
			SuffixArray[i] = Ansbuffer[i+1];
		}
	}
};
void Calc(){
	int K = rei()+1;
	string input = res();
	int N = input.length();
	vector<int> A(input.length());
	for(int i=0;i<N;i++){
		A[i] = input[i]-'1';
	}
	int digit = (N + K - 1) / K;
	if(digit == 1){
		int ans = 0;
		for(int val:A){
			ans = max(ans,val);
		}
		ans++;
		cout << ans << endl;
		return;	
	}
	StringManager S(A,9);	
	S.SAIS();
	vector<int> rSuffixArray(N);
	for(int i=0;i<N;i++){
		rSuffixArray[S.SuffixArray[i]] = i;
	}
	int bf = 0;
	int bl = N-1;
	deque<pair<int,int>> deq;
	while(bf != bl){
		int bc = (bf+bl+1)/2;
		deq.push_front({0,0});
		for(int i=1;i<=N;i++){
			while(true){
				int x = deq.front().first;
				if(i-x < digit || (i-x == digit && rSuffixArray[x] < bc)){
					break;
				}
				deq.pop_front();
			}
			int d = deq.front().second+1;
			while(!deq.empty()){
				int y = deq.back().second;
				if(d > y){
					break;
				}
				deq.pop_back();
			}
			deq.push_back({i,d});
		}
		if(deq.back().second > K){
		     bf = bc;
		}
		else{
			bl = bc-1;
		}
		deq.clear();
	}
	cout << input.substr(S.SuffixArray[bf],digit) << endl;
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 5200