Maximum Number#11762

Maximum Number

0.1 seconds
256 megabytes
Easy

You are given an integer . You can take the first digit of this number and move it to the end of the number, leaving the order of the remaining digits unchanged. You are allowed to repeat this operation any number of times. Determine the maximum number that can be obtained as a result of such operations.

Input

The input is presented as a single natural number (1 ≤ N ≤ 10^{10000}).

Output

Output a single value – the largest number that can be obtained by performing such permutations.

Examples

Example 1

Loading
Loading

Note

  • Initial number:

  • After the first permutation, we get:

  • Perform another permutation: