859. Magic Swap Number

0

Medium

Given an integer N, you are allowed to perform a

**Magic Swap**operation, which involves swapping two digits at most once. Find the maximum possible value of N after performing the Magic Swap operation.Input Format

A positive integer number.

Output Format

Print the value of N after performing the Magic Swap operation.

Example

Input

68391

Output

98361

Constraints

1<= N <= 10

^{8}Loading...

View Submissions

Console