#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0;}
template<class T>bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0;}

using ll = long long;
using R = long double;
const R EPS = 1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max(x, 0.0L));}

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

#define error(args...) { vector<string> _debug = split(#args, ',');err(begin(_debug), args);}

vector<string> split(const string& s, char c) {
	vector<string> v; stringstream ss(s); string x;
	while (getline(ss, x, c)) v.emplace_back(x);
	return move(v);
}

void err(vector<string>::iterator it) {cerr << endl;}
template<typename T, typename... Args> void err(vector<string>::iterator it, T a, Args... args) {
	cerr << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << " ", err(++it, args...);
}

auto suffix_array(string s) {
	const int n = s.size();
	vector<int> sa(n + 1), rnk(n + 1, 0), tmp(n + 1, 0);
	rep(i, n + 1) sa[i] = i, rnk[i] = (i < n ? s[i] : -1);
	for (int k = 1; k <= n; k <<= 1) {
		auto cmp = [&](int i, int j) {
			if (rnk[i] != rnk[j]) return rnk[i] < rnk[j];
			int ci = (i + k <= n) ? rnk[i + k] : -1;
			int cj = (j + k <= n) ? rnk[j + k] : -1;
			return ci < cj;
		};
		sort(begin(sa), end(sa), cmp);
		tmp[sa[0]] = 0;
		rep(i, n) tmp[sa[i + 1]] = tmp[sa[i]] + cmp(sa[i], sa[i + 1]);
		rep(i, n + 1) rnk[i] = tmp[i];
	}
	return make_tuple(rnk, sa);
}

string s;
int k;
vector<int> rnk, sa;

const int limit = 100010;
bool skip[limit];
int dp[limit];

bool check(int pos, int mlen) {
	const int n = s.size();
	rep(i, n + 1) dp[i] = limit;
	dp[0] = 0;

	rep(i, 1, n + 1) {
		{
			const int j = max(0, i - mlen + 1);
			chmin(dp[i], dp[j] + 1);
		}

		{
			const int j = max(0, i - mlen);
			if (rnk[j] <= pos) chmin(dp[i], dp[j] + 1);
		}
	}

	// error(mlen);
	// rep(i, n + 1) cerr << dp[i];
	// cerr << endl;

	return (dp[n] <= k);
}


int main(void) {
	cin >> k >> s, k++;

	const int n = s.size();
	const int mlen = (n + k - 1) / k;

	tie(rnk, sa) = suffix_array(s);

	int low = 0, high = n;

	while (high - low > 1) {
		const int mid = (low + high) / 2;
		if (check(mid, mlen))
			high = mid;
		else
			low = mid;
	}

	// rep(i, n + 1) error(i, rnk[i]);

	// rep(i, n + 1) error(i, sa[i], s.substr(sa[i]));

	// error(4, check(4, mlen));

	cout << s.substr(sa[high], mlen) << endl;

	return 0;
}

Measured memory_bytes: 2560