import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

string RD() { return chomp(readln()); }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto s = RD;
	auto tokens = RD.split;
	auto K = tokens[0].to!long;
	
	string[][26] ss;

	foreach (i, c; s)
	{
		auto ssi = c - 'a';
		ulong cnt;
		foreach (e; ss[0..ssi]) cnt += e.length;
		if (cnt >= K) continue;

		foreach (j; i+1..min(i+K+1, s.length+1))
		{
			if (countUntil(ss[ssi], s[i..j]) == -1)
				ss[ssi] ~= s[i..j];
		}
	}

	string ans;
	ulong cnt;
	foreach (ref e; ss)
	{
		cnt += e.length;
		if (cnt >= K)
		{
			e.sort();
			ans = e[K - 1 - (cnt - e.length)];
			break;
		}
	}

	writeln(ans);
	stdout.flush();
}