eolymp
bolt
Try our new interface for solving problems
Problems

Counterfeit check

Counterfeit check

\includegraphics{https://static.e-olymp.com/content/46/46bedd4f6a397ecec452f2f6fa5920b746d6dd1e.jpg} One way of fraud, developed by Ostap Bender, is as follows. He cut a strip of paper containing a few figures of the amount of the check (you can cut and extreme figures), cut it into two parts, rearranged these two places and carefully glued back. Write a program that determines the maximum number that can be obtained as a result of this manipulation. \InputFile In the input file in the first line contains one positive integer not more than \textbf{100} digits. \OutputFile In the output file display one number - the maximum number that can be obtained as a result of this manipulation, the original number or if the increase is impossible.
Time limit 1 second
Memory limit 64 MiB
Input example #1
9123650
Output example #1
9651230