"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let S = cin.getStr(), K = cin.getInt();
    let A = [];
    for (let n = 0; n < S.length; n++) {
        for (let m = 1; m <= Math.min(K, S.length - n); m++) {
            A.push(S.substr(n, m));
        }
    }
    A.sort();
    let k = 0, n = 0, s = "";
    while (true) {
        if (s == A[n]) { n++; continue; }
        s = A[n];
        if (++k == K) {
            console.log(s);
            return;
        }
        n++;
    }
}
class Inputer{constructor(t){if(typeof t=='undefined')throw new Error('引数（stdin）を省略できません！');this.cnt=0,this.items=t.split(/\n|\s/)}getInt(){return this.items[this.cnt++]-0}getIntArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getInt();return r}getStr(){return this.items[this.cnt++]}getStrArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getStr();return r}}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));