'use strict'

function main(s) {

  s = s.split('\n')
  const str = s[0];
  const len = str.length;
  const k = Number(s[1]);
  const chars = [...new Set(str.split(''))].sort();
  const dic = new Set();

  let charIndex = 0;
  while (dic.size < k) {

    for (let i = 0; i < len; i++) {
      let j = 1;
      if (str.slice(i, i + j) !== chars[charIndex]) continue;

      while (i + j <= len && j <= 5) {
        dic.add(str.slice(i, i + j));
        j += 1;
      }
    }

    charIndex += 1;
  }

  const ans = [...dic].sort()[k - 1];
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
