#C5980. Sort Digits with Letter Order Preservation

    ID: 49689 Type: Default 1000ms 256MiB

Sort Digits with Letter Order Preservation

Sort Digits with Letter Order Preservation

Given a string containing letters, digits, and other non-alphanumeric characters, your task is to extract all the digits, sort them in non-decreasing order, and place them at the beginning of the string. The letters should retain their original order as they appear in the input. All non-alphanumeric characters must be ignored.

For example, if the input is "a1c3b2", the output should be "123acb".

inputFormat

The input is provided through standard input (stdin) as a single line string. The string may contain letters, digits, and other symbols.

outputFormat

The output should be printed to standard output (stdout) as a single string, which is the processed result containing the sorted digits followed by the letters in their original order.## sample

a1c3b2
123acb