#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <unordered_map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int n, k;
int rk[100002];
int tmp[100002];

bool compare_sa(int i, int j){
  if(rk[i]!=rk[j]) return rk[i]<rk[j];
  else{
    int ri, rj;
    if(i+k<=n) ri=rk[i+k];
    else ri=-1;
    if(j+k<=n) rj=rk[j+k];
    else rj=-1;
    return ri<rj;
  }
}

void construct_sa(string s, int *sa){
  n=s.size();
  for(int i=0; i<=n; i++){
    sa[i]=i;
    if(i<n){
      rk[i]=s[i]-'0';
    }else{
      rk[i]=-1;
    }
  }
  for(k=1; k<=n; k*=2){
    sort(sa, sa+n+1, compare_sa);
    tmp[sa[0]]=0;
    for(int i=1; i<=n; i++){
      tmp[sa[i]]=tmp[sa[i-1]];
      if(compare_sa(sa[i-1], sa[i])) tmp[sa[i]]++;
    }
    for(int i=0; i<=n; i++) rk[i]=tmp[i];
  }
}

int main()
{
	ll h;
  cin>>n>>h;
  string s;
  cin>>s;
  ll w[100001]={}, ws[100001];
  ws[0]=0;
  ll ct=0;
  ll z=0;
  for(int i=0; i<n; i++){
    if(s[i]=='0'){
      ct++;
    }else{
      w[i]=ct+1;
      z+=ct*(ct+1)/2;
      ct=0;
    }
  }
  w[n]=ct+1;
  z+=ct*(ct+1)/2;
  if(h<=z){
    cout<<0<<endl;
    return 0;
  }
  ws[0]=0;
  for(int i=1; i<=n; i++) ws[i]=ws[i-1]+w[i-1];
  h-=z;
  int sa[100001];
  construct_sa(s, sa);
  //for(int i=0; i<=n; i++) cout<<sa[i]<<" ";
  //cout<<endl;
  for(int d=1; d<=n; d++){
    if(ws[n-d+1]<h){
      h-=ws[n-d+1];
      continue;
    }
    for(int i=1; i<=n; i++){
      if(sa[i]>n-d || s[sa[i]]=='0') continue;
      if(h<=w[sa[i]]){
        for(int j=0; j<d; j++) cout<<s[sa[i]+j];
        cout<<endl;
        return 0;
      }
      h-=w[sa[i]];
    }
  }
	return 0;
}
