e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Competitions

Week 8: December 28 - January 10. Functions. Part 1

Sort the letters

A string consisting of lowercase Latin letters is given. Sort its letters in ascending and then in descending lexicographical order.

Input

One line that contains no more than 100 lowercase Latin letters 'a' - 'z'.

Output

In the first line, output the sorted input string in non-decreasing order of its ASCII codes. In the second line, output the sorted input string in non-increasing order of its ASCII codes.

Time limit 1 second
Memory limit 128 MiB
Input example #1
qwerty
Output example #1
eqrtwy
ywtrqe