#C2296. Ordered Characters

    ID: 45596 Type: Default 1000ms 256MiB

Ordered Characters

Ordered Characters

You are given a string s. Your task is to rearrange the characters of s according to its length: if the length is odd, output the characters in ascending (lexicographical) order, and if the length is even, output the characters in descending order.

More formally, let \( s \) be a string. If \( |s| \) is odd, return \( \text{sort}(s) \), and if \( |s| \) is even, return \( \text{sort}(s)\text{ reversed} \). For example, for s = "coding" (an even-length string), the result is "onigdc"; for s = "hello" (an odd-length string), the result is "ehllo".

inputFormat

The input consists of a single line containing the string s. The string may be empty and will only contain printable ASCII characters.

outputFormat

Output the transformed string according to the problem statement. The output should be printed as a single line to stdout.

## sample
coding
onigdc