// コードをここに挿入。
function main(input) {
    input = input.split("\n");
    var s = input[0];
    var k = input[1];
    var temp = [""];
    for (i = 0; i < s.length - 1; i++) {
        for (j = i; j < s.length - 1; j++) {
            temp.push(s.substring(i, j));
        }
    }
    temp = margeSort(temp);
    var hoge = 1;
    var foo = 0;
    while (hoge !== k) {
        if (temp[foo] === temp[foo + 1]) {
            foo++;
        }
        else {
            foo++;
            hoge++;
        }
    }
    console.log(temp[foo]);


}

function margeSort(a) {
    var split = function (array) {
        //console.log('original: ' + array.toString());
        if (array.length < 2) {
            return array;
        }
        var a, b, mid = array.length / 2 | 0;
        a = split(array.slice(0, mid));
        b = split(array.slice(mid, array.length));
        return marge(array, a, b);
    },
        marge = function (array, a, b) {
            if (b === undefined) {
                return array;
            }
            var c = [], i, j;
            while (a.length > 0 && b.length > 0) {
                i = a[0], j = b[0];
                //console.log('marge: ' + a.toString() + ' <==> ' + b.toString());
                if (i < j) {
                    c.push(a.shift())
                } else {
                    c.push(b.shift())
                }
            }
            if (a.length === 0) {
                c = c.concat(b);
            } else if (b.length === 0) {
                c = c.concat(a);
            }
            return c;
        }
    return split(a);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
