BrojHHH
Mirko i Slavko have found several pieces of paper with the decimal digits (0 through 9) under their desks. Delighted by this discovery, the bet is a 100 Chromos chewing Who will you find pieces of paper to create what is possible in which a larger number of any two adjacent digits are not the same parity (that can not be both even or both odd). Here, we consider the digit 0 even. As it comes to real wealth, Mirko decided to cheat and ask you to write a program that finds the greatest number.
Note : There is no need to use all the digits.
input
output
Input Input data
The first and only line the entrance there is a series of up to 20 characters. Each character has a decimal
digit (0 through 9) and corresponds to one piece of paper.
The first and only line the entrance there is a series of up to 20 characters. Each character has a decimal
digit (0 through 9) and corresponds to one piece of paper.
Output Output
In a single line of output should contain the maximum number that satisfies the rules from the text of the task.
In a single line of output should contain the maximum number that satisfies the rules from the text of the task.
Note : There is no need to use all the digits.
Examples of test data
input
output
input
567 output
765 input
7989 output
989 Submit solution
Sign in to submit a solution.