var lines = []; var result = 0;
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
})

rl.on('close', function () {
    var S = lines[0].split("");
    var K = Number(lines[1]);

    var str = Array(S.length).fill("").map(value => value = Array(S.length).fill(""));
    str[0][0] = ""

    var dictionary = [];
    for (var i = 0; i < S.length; i++) {
        for (var j = i; j < S.length; j++) {
            if (K < str[i][j].length) { break; }

            str[i][j + 1] = str[i][j] + S[j];
            dictionary.push(str[i][j + 1])
        }
    }
    dictionary = dictionary.filter((value, index, array) => {
        return (array.indexOf(value) === index);
    });

    dictionary.sort()
    console.log(dictionary[K - 1]);
});
