#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int N,K;
vi Rank,Tmp;

bool Comp(int i,int j){
	if(Rank[i]!=Rank[j]) return Rank[i]<Rank[j];
	int ri=i+K<=N?Rank[i+K]:-1,rj=j+K<=N?Rank[j+K]:-1;
	return ri<rj;
}

vi Suffix_Array(string s){
	N=s.size();
	vi sa(N+1);
	Rank=Tmp=vi(N+1);
	for(int i=0;i<=N;i++){
		sa[i]=i;
		Rank[i]=i<N?s[i]:-1;
	}
	for(K=1;K<=N;K*=2){
		sort(sa.begin(),sa.end(),Comp);
		Tmp[sa[0]]=0;
		for(int i=1;i<=N;i++) Tmp[sa[i]]=Tmp[sa[i-1]]+(Comp(sa[i-1],sa[i])?1:0);
		Rank=Tmp;
	}
	return sa;
}

int n,k,m;
string s;
vi a,sa;

bool f(int x){
	int t=0,I=0,num=n-(m-1)*(k+1);
	for(int i=0;i<=k;i++){
		if(a[I]<=x&&t<num) I+=m,t++;
		else I+=m-1;
	}
	return t==num;
}

int main(){
	cin>>k>>s;
	n=s.size(),m=(n+k)/(k+1);
	sa=Suffix_Array(s);
	a=vi(n-m+1);
	int l=-1,r=n-m,id=0;
	for(int i=0;i<=n;i++) if(sa[i]<=n-m) a[sa[i]]=id++;
	while(r-l>1){
		int mid=(l+r)/2;
		if(f(mid)) r=mid;
		else l=mid;
	}
	for(int i=0;i<n-m+1;i++) if(a[i]==r) cout<<s.substr(i,m)<<endl;
}