#C14579. Separate and Sort Characters

    ID: 44243 Type: Default 1000ms 256MiB

Separate and Sort Characters

Separate and Sort Characters

You are given a string S which may contain letters, digits, and special characters. Your task is to implement an algorithm that separates the letters and the digits from the string, sorts each group individually, and outputs the concatenation of the sorted letters followed by the sorted digits.

Important: Special characters should be ignored.

Sorting Details:

  • Letters should be sorted alphabetically in a case-insensitive manner (i.e., 'A' and 'a' are considered equal for sorting, but the original case is preserved in the output as per their order after sorting).
  • Digits should be sorted in ascending order.

For example, given the input a1b2c3, the output should be abc123.

inputFormat

The input consists of a single line containing the string S. The string may include letters, digits, and other special characters. You only need to consider letters and digits.

Input Format: S

outputFormat

Output a single line which is the result of concatenating the sorted letters and the sorted digits.

Output Format: result

## sample
a1b2c3
abc123

</p>