#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

string s;
char s_[111111];
int k;

struct SA {
  string s;
  vector<int> sa, pos;
  int gap;
  
  void build(const string& s_) {
    s = s_;
    sa.resize(s.size());
    pos.resize(s.size());
    auto comp = [&](int a, int b) {
      if (pos[a] != pos[b]) return pos[a] < pos[b];
      a += gap;
      b += gap;
      return (a < int(s.size()) &&
              b < int(s.size())) ? pos[a] < pos[b] : a > b;
    };
    for (size_t i = 0; i < s.size(); i++) {
      sa[i] = i;
      pos[i] = s[i];
    }
    vector<int> t(s.size());
    for (gap = 1;; gap *= 2) {
      sort(sa.begin(), sa.end(), comp);
      for (size_t i = 0; i+1 < s.size(); i++) {
        t[i+1] = t[i] + (comp(sa[i], sa[i+1]) ? 1 : 0);
      }
      for (size_t i = 0; i < s.size(); i++) {
        pos[sa[i]] = t[i];
      }
      if (t.back() == int(s.size())-1) break;
    }
  }
};

SA sa;
vector<int> vs;
int l;

bool test(int j) {
  int c = 0;
  string buf = "";
  string t = s.substr(j, l);
  // printf("%s\n", t.c_str());
  for (size_t i = 0; i < s.size(); i++) {
    // printf("%zd: %d %d\n", i, x, c);
    // printf("%zd: %s %d\n", i, buf.c_str(), c);
    if (l == 1) {
      if (s[i] > t[0]) return false;
    }
    if (((buf.size()+1 == t.size() && buf+s[i] > t) || buf.size()+1 > t.size())) {
      buf = s[i];
      ++c;
    } else {
      buf += s[i];
    }
  }
  return c <= k;
}

int main(void) {
  scanf("%d%s", &k, s_); s = s_;
  sa.build(s);
  l = (s.size()+k)/(k+1);
  for (int i = 0; i < int(sa.sa.size()); i++) {
    if (sa.sa[i]+l <= int(s.size())) {
      vs.push_back(sa.sa[i]);
    }
  }

  int lb = -1;
  int rb = vs.size()-1;
  while (rb-lb > 1) {
    int mb = (lb+rb)/2;
    if (test(vs[mb])) {
      rb = mb;
    } else {
      lb = mb;
    }
  }
  printf("%s\n", s.substr(vs[rb], l).c_str());
  return 0;
}
