#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
struct StringManager{
	const vector<int> S;
	const int maxChar;
	const int N;
	vector<int> SuffixArray;
	vector<int> rSuffixArray;
	vector<int> LCPArray;
	StringManager(const vector<int>& data_,int c)
        : S(data_), maxChar(c), N(data_.size()) {
    }
	static vector<int> StringToIntArray(string s){
		vector<int> ans(s.length());
		for(int i=0;i<s.length();i++){
			ans[i] = s[i] - 'a';
		}
		return ans;
	}
	StringManager(string s)
        : S(StringToIntArray(s)), maxChar(26), N(s.length()) {
    }
	void SAIS(){
		//文字列を格納
		vector<int> Sbuffer(N*2+10);
		//S-typeかL-typeか
		vector<bool> SLbuffer(N*2+10);
		//LMS−typeなら何番目か
		vector<int> rLMSbuffer(N*2+10);
		//LMS−typeの場所
		vector<int> LMSbuffer(N+100);
		//Binの境界をを格納
		vector<int> Binbuffer(maxChar+N+100);
		//Binをどこまでうめたか必要な時に使う
		vector<int> BinPointerbuffer(maxChar+N+100);
		vector<tuple<int,int,int,int,int,int>> WorkInformation(100);
		vector<int> Ansbuffer(N*2+10,-1);
		for(int i=0;i<N;i++){
			Sbuffer[i] = S[i]+1;
		}
		Sbuffer[N] = 0;
		WorkInformation[0] = make_tuple(0,0,0,maxChar+1,N+1,0);
		int WorkPointer = 0;
		while(WorkPointer >= 0){
			const int Spointer = get<0>(WorkInformation[WorkPointer]);
			const int Binpointer = get<1>(WorkInformation[WorkPointer]);
			const int LMSpointer = get<2>(WorkInformation[WorkPointer]);
			const int CharNum = get<3>(WorkInformation[WorkPointer]);
			const int SLength = get<4>(WorkInformation[WorkPointer]);
			int LMSnum = get<5>(WorkInformation[WorkPointer]);
			WorkPointer--;
			//最初に問題を解く時
			if(LMSnum == 0){
				//S-typeかL-typeかを計算
				SLbuffer[Spointer+SLength-1] = true;
				for(int i=SLength-2;i>=0;i--){
					if(Sbuffer[Spointer+i] < Sbuffer[Spointer+i+1]){
						SLbuffer[Spointer+i] = true;
					}
					else if(Sbuffer[Spointer+i] > Sbuffer[Spointer+i+1]){
						SLbuffer[Spointer+i] = false;
					}
					else{
						SLbuffer[Spointer+i] = SLbuffer[Spointer+i+1];
					}
				}
				//LMS-typeを格納
				for(int i=1;i<SLength;i++){
					if(SLbuffer[Spointer+i] && !SLbuffer[Spointer+i-1]){
						LMSbuffer[LMSpointer+LMSnum] = i;
						LMSnum++;
						rLMSbuffer[Spointer+i] = LMSnum;
					}
				}
				//Binbufferを計算
				for(int i=0;i<SLength;i++){
					Binbuffer[Binpointer+Sbuffer[Spointer+i]+1]++;
				}
				for(int i=1;i<CharNum;i++){
					Binbuffer[Binpointer+i+1] += Binbuffer[Binpointer+i];
				}
				//LMS-typeをそれぞれのbinごとに後ろから入れていく　同時に頭文字が同じLMSが存在するか確認
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				bool SameTopCharacterLMSExist = false;
				for(int i=0;i<LMSnum;i++){
					int ch = Sbuffer[Spointer+LMSbuffer[LMSpointer+i]];
					Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = LMSbuffer[LMSpointer+i];
					SameTopCharacterLMSExist |= BinPointerbuffer[Binpointer+ch] != Binbuffer[Binpointer+ch+1]-1;
					BinPointerbuffer[Binpointer+ch]--;
				}
				//LMS-typeを基にL-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i];
				}
				for(int i=0;i<SLength;i++){
					int v = Ansbuffer[Spointer+i];
					if(v > 0){
						if(!SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]++;
						}
					}
				}
				//L-typeを基にS-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				for(int i=SLength-1;i>=0;i--){
					int v = Ansbuffer[Spointer+i];
					if(v != 0){
						if(SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]--;
						}
					}
				}
				//LMS-typeの順番が間違っている可能性のある時
				if(SameTopCharacterLMSExist){
					int newSpointer = Spointer+SLength;
					//新しい文字列を作る
					int beforeLMSString = -1;
					int LMSStringKind = -1;
					for(int i=0;i<SLength;i++){
						int v = Ansbuffer[Spointer+i];
						if(rLMSbuffer[Spointer+v] != 0){
							int afterLMSString = rLMSbuffer[Spointer+v]-1;
							//種類が違うか判断　最初はダミー文字で他と一致しないことに注意
							if(LMSStringKind > 0){
								int beforeLMSStringF = LMSbuffer[LMSpointer+beforeLMSString];
								int beforeLMSStringT = LMSbuffer[LMSpointer+beforeLMSString+1];
								int afterLMSStringF = LMSbuffer[LMSpointer+afterLMSString];
								int afterLMSStringT = LMSbuffer[LMSpointer+afterLMSString+1];
								if(beforeLMSStringT - beforeLMSStringF == afterLMSStringT - afterLMSStringF){
									int c = beforeLMSStringT - beforeLMSStringF;
									for(int i=0;i<=c;i++){
										if(Sbuffer[Spointer+beforeLMSStringF+i] != Sbuffer[Spointer+afterLMSStringF+i]){
											LMSStringKind++;
											break;
										}
									}
									LMSStringKind--;
								}
							}
							LMSStringKind++;
							Sbuffer[newSpointer+rLMSbuffer[Spointer+v]-1] = LMSStringKind;
							beforeLMSString = afterLMSString;
						}
					}
					LMSStringKind++;
					WorkInformation[WorkPointer+1] = make_tuple(Spointer,Binpointer,LMSpointer,CharNum,SLength,LMSnum);
					WorkInformation[WorkPointer+2] = make_tuple(Spointer+SLength,Binpointer+CharNum+1,LMSpointer+LMSnum,LMSStringKind,LMSnum,0);
					WorkPointer += 2;
				}
			}
			//再帰から戻った後
			else{
				int newSpointer = Spointer+SLength;
				//Ansbufferを初期化
				for(int i=Spointer;i<newSpointer;i++){
					Ansbuffer[i] = -1;
				}
				//LMS-typeをそれぞれのbinごとに後ろから入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				for(int i=LMSnum-1;i>=0;i--){
					int ch = Sbuffer[Spointer+LMSbuffer[LMSpointer+Ansbuffer[newSpointer+i]]];
					Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = LMSbuffer[LMSpointer+Ansbuffer[newSpointer+i]];
					BinPointerbuffer[Binpointer+ch]--;
				}
				//LMS-typeを基にL-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i];
				}
				for(int i=0;i<SLength;i++){
					int v = Ansbuffer[Spointer+i];
					if(v > 0){
						if(!SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]++;
						}
					}
				}
				//L-typeを基にS-typeを入れていく
				for(int i=0;i<CharNum;i++){
					BinPointerbuffer[Binpointer+i] = Binbuffer[Binpointer+i+1]-1;
				}
				for(int i=SLength-1;i>=0;i--){
					int v = Ansbuffer[Spointer+i];
					if(v != 0){
						if(SLbuffer[Spointer+v-1]){
							int ch = Sbuffer[Spointer+v-1];
							Ansbuffer[Spointer+BinPointerbuffer[Binpointer+ch]] = v-1;
							BinPointerbuffer[Binpointer+ch]--;
						}
					}
				}
			}
		}
		SuffixArray.resize(N);
		rSuffixArray.resize(N);
		for(int i=0;i<N;i++){
			SuffixArray[i] = Ansbuffer[i+1];
			rSuffixArray[Ansbuffer[i+1]] = i;
		}
	}
	void CalculateLCP(){
		if(SuffixArray.size() == 0){
			SAIS();
		}
		LCPArray.resize(N);
		int lcp = 0;
		for(int p=0;p<N;p++){
			int i = rSuffixArray[p];
			if(i > 0){
				while(p+lcp < N && SuffixArray[i-1]+lcp < N && S[p+lcp] == S[SuffixArray[i-1]+lcp]){
					lcp++;
				}
			}
			else{
				lcp = 0;
			}
			LCPArray[i] = lcp;
			if(lcp > 0){
				lcp--;
			}
		}
	}
};
int LeftZero[100000];
void Calc(){
	int N = rei();
	long C = rel();
	vector<int> S(N);
	{
		string s = res();
		for(int i=0;i<N;i++){
			S[i] = s[i] - '0';
		}
	}
	long Zero = 0;
	for(int i=0;i<N;i++){
		if(i != 0 && S[i-1] == 0){
			LeftZero[i] = LeftZero[i-1]+1;
		}
		if(S[i] == 0){
			Zero += LeftZero[i]+1;
		}
	}
	if(Zero >= C){
		cout << 0 << endl;
		return;
	}
	C -= Zero;
	int digit = 1;
	int num = N;
	for(int i=N-1;i>=0;i--){
		if(S[i] != 0){
			break;
		}
		num--;
	}
	while(C > num){
		C -= num;
		digit++;
		if(S[N-digit+1] != 0){
			num -= LeftZero[N-digit+1]+1;
		}
	}
	StringManager SM(S,10);
	SM.SAIS();
	for(int i=0;;i++){
		int p = SM.SuffixArray[i];
		if(S[p] != 0 && p <= N-digit){
			C -= LeftZero[p]+1;
			if(C <= 0){
				for(int j=0;j<digit;j++){
					cout << S[p+j];
				}
				cout << endl;
				return;
			}
		}
	}
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}
