#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-8;

long long int N, M, K, L, R, H, W;
//int N, M, K, L, R, H, W;

class SuffixArray {
	string s;
	vector<int>nx;
	int length = 1;
	int n;
public:
	vector<int>ret;
	vector<int>id;
	vector<int>lcp;
	SuffixArray(string ss) {
		s = ss;
		n = s.size();
		id.resize(n);
		nx.resize(n);
		ret.resize(n);
		lcp.resize(n);
		for (int i = 0; i < n; i++) {
			ret[i] = i;
		}
		for (int i = 0; i < n; i++) {
			id[i] = s[i];
		}
		while (length < n) {
			auto comp = [&](int a, int b) {
				if (id[a] != id[b])return id[a] < id[b];
				int l = -1, r = -1;
				if (a + length < n)l = id[a + length];
				if (b + length < n)r = id[b + length];
				return l < r;
			};
			sort(ret.begin(), ret.end(), comp);
			nx[ret[0]] = 0;
			for (int i = 1; i < n; i++) {
				nx[ret[i]] = nx[ret[i - 1]] + comp(ret[i - 1], ret[i]);
			}
			id = nx;
			length <<= 1;
		}
		for (int i = 0; i < n; i++) {
			int nx = id[i];
			if (nx + 1 == n)continue;
			nx = ret[nx + 1];
			int idx = i;
			if (i&&lcp[id[i - 1]]) {
				lcp[id[i]] = lcp[id[i - 1]] - 1;
				nx += lcp[id[i]];
				idx += lcp[id[i]];
			}
			while (nx < n&&i < n&&s[idx] == s[nx]) {
				lcp[id[i]]++;
				nx++;
				idx++;
			}
		}
	}
};

class Segment_Tree {
	vector<long long int>v;
	int num;
	long long int ret;
	bool is_min;
	long long int Update(int place) {
		if (place >= v.size() / 2) {
			return v[place];
		}
		if (is_min) {
			v[place] = min(Update(place * 2), Update(place * 2 + 1));
			return v[place];
		}
		v[place] = max(Update(place * 2), Update(place * 2 + 1));
		return v[place];
	}
public:
	Segment_Tree(int n, bool min) {
		n++;
		num = 1;
		while (num < n * 2) {
			num *= 2;
		}
		is_min = min;
		if (min) {
			v.resize(num, MOD*MOD);
		}
		else v.resize(num, -MOD * MOD);
	}
	void Insert(int place, long long int num, bool update) {
		place += v.size() / 2;
		v[place] = num;
		if (!update)return;
		place /= 2;
		while (place) {
			if (is_min)v[place] = min(v[place * 2], v[place * 2 + 1]);
			else v[place] = max(v[place * 2], v[place * 2 + 1]);
			place /= 2;
		}
	}
	void TopDown() {
		Update(1);
	}
	long long int RMQ(int a, int b) {
		if (is_min)ret = LLONG_MAX;
		else ret = LLONG_MIN;
		if (is_min) {
			b++;
			for (a += num / 2, b += num / 2; a < b; a >>= 1, b >>= 1) {
				if (a & 1)ret = min(ret, v[a++]);
				if (b & 1)ret = min(ret, v[--b]);
			}
		}
		else {
			b++;
			for (a += num / 2, b += num / 2; a < b; a >>= 1, b >>= 1) {
				if (a & 1)ret = max(ret, v[a++]);
				if (b & 1)ret = max(ret, v[--b]);
			}
		}
		return ret;
	}
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> K;
	string s;
	cin >> s;
	SuffixArray sa(s);
	L = -1, R = s.size();
	N = s.size();
	M = (s.size() + K) / (K + 1);
	while (R - L > 1) {
		int mid = (R + L) / 2;
		Segment_Tree l(N * 2 + 10, true);
		Segment_Tree r(N * 2 + 10, false);
		l.Insert(N, 0, true);
		r.Insert(N, 0, true);
		for (int i = N - 1; i >= 0; i--) {
			long long int a = MOD, b = 0;
			if (sa.id[i] <= mid) {
				a = min(a, l.RMQ(i + 1, i + M));
				b = max(b, r.RMQ(i + 1, i + M));
			}
			else {
				a = min(a, l.RMQ(i + 1, i + M - 1));
				b = max(b, r.RMQ(i + 1, i + M - 1));
			}
			if (a == MOD) {
				a = b = MOD;
			}
			else {
				a++, b++;
			}
			l.Insert(i, a, true);
			r.Insert(i, b, true);
		}
		if (l.RMQ(0, 0) <= K+1 && K+1 <= r.RMQ(0, 0)) {
			R = mid;
		}
		else {
			L = mid;
		}
	}
	//cout << R << endl;
	cout << s.substr(sa.ret[R], M) << endl;
}

Measured memory_bytes: 10320