406152: GYM102279 J Jumpity Digits
Description
Seo is an expert in electronics (as well as codeforces). Also, he is a very very good friend of B21.
One time, B21 call him for help: the electricity board that shows the distance between Earth and the nearest black hole in nanometres has a glitch. As B21 said: there were two "jumpity digits" that made the numbers display on the board became false.
Right now, the number on the board is $$$X$$$. B21 states that the number that must be displayed on the board is smaller than $$$X$$$, and as optimistic as the person B21 is, he states that it should be the greatest possible number.
Help Seo find the number that must be displayed, or determine that it is impossible, which means there were some fallacies in B21's statements.
InputThe only line in the input contains an integer: $$$X$$$ ($$$1 \le X \le 10^{100}$$$) - the number that is displaying on the board.
OutputPrint "-1" if it is impossible to find the number. Else, print that number on a single line.
ExamplesInput354Output
345Input
999Output
-1Input
100Output
-1Input
11101Output
11011Input
2Output
-1