import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	auto s = readln.chomp;
	auto k = read.to!int;
	
	bool[string] xset;
	for(int i = 0; i < s.length; i ++){
		for(int j = i + 1; j < i + 10 && j <= s.length; j ++){
			xset[s[i .. j]] = 1;
			}
		}
	
	string[] xs = xset.keys;
	xs.sort();
	
	debug xs.writeln;
	
	xs[k - 1].writeln;
	
	}