Vasya decide pass large integer n Kate First write number string append right integer k number digit n Magically number shuffle arbitrary order note pass Kate the thing Vasya remember nonempty substre n substre n sequence consecutive digit number nVasya know way restore number n your task find small possible initial integer n note decimal representation number n contain lead zeroes case integer n equal zero case single digit 0