#C10930. Smallest Lexicographical Permutation

    ID: 40190 Type: Default 1000ms 256MiB

Smallest Lexicographical Permutation

Smallest Lexicographical Permutation

Given a string \( s \), you are required to obtain the smallest lexicographical permutation of the string by only performing adjacent swaps. In each swap, you may only swap two consecutive characters.

For example, the string "cba" can be transformed into "abc" through a series of adjacent swaps. Essentially, this process is analogous to a bubble sort where the final result is the sorted order of the characters.

Note: The input string will only consist of lowercase English letters.

inputFormat

The input consists of a single line containing the string \( s \) (where \( 1 \leq |s| \leq 1000 \)).

outputFormat

Output a single line containing the smallest lexicographical permutation of the given string.

## sample
cba
abc