object Main {

  def calc(s: String, K: Int): String = {
    val chars = ('a' to 'z').mkString

    def next(str: String): String = {
      val ix = chars.indexOf(str.last)
      if (ix == 25) { // 末尾が'z'
        next(str.dropRight(1))
      } else {
        val c = chars(ix + 1)
        str.dropRight(1) + c
      }
    }

    def step(k: Int, building: String): String = k match {
      case 0 => building.dropRight(1) // 最後に'a'が足されている
      case _ =>
        s.indexOf(building) match {
          case -1 => step(k, next(building))
          case _ => step(k - 1, building + 'a')
        }
    }

    step(K, "a")
  }

  def main(args: Array[String]): Unit = {
    val in = io.Source.fromInputStream(System.in).getLines()
    val s = in.next()
    val K = in.next().toInt
    System.out.println(calc(s, K))
  }
}