Number Puzzle#440

Number Puzzle

1 second
64 megabytes
Easy

You are given a positive integer written as a string of digits. You may select a contiguous substring (consisting of one or more digits, possibly including the first or last digit), divide this substring into two non-empty parts, swap their order, and place them back in the original position. Your task is to find the maximum possible number obtainable by such a single operation.

Input

The first line contains a single positive integer with at most digits.

Output

Output the maximum number that can be obtained with this operation, or the original number if it cannot be increased.

Examples

Example 1

Loading
Loading