#C14068. Move Digits to End
Move Digits to End
Move Digits to End
You are given a string S consisting of a mixture of letters and digits. Your task is to rearrange the string so that all the letters come first, followed by all the digits, while preserving the relative order of the letters and of the digits.
In other words, if S = L1L2…LkD1D2…Dm where the letters and digits are interleaved, your output should be:
$$\text{Output} = L_{\text{order}} + D_{\text{order}}, $$where Lorder is the sequence of all letters in the order they appear in S, and Dorder is the sequence of all digits in the order they appear in S.
Example: For input a1b2c3
, the output is abc123
.
inputFormat
The input consists of one line containing the string S (which can include both alphabets and digits). The string may be empty.
Note: The input should be read from standard input (stdin).
outputFormat
Output a single line containing the modified string where all the digit characters are moved to the end after all the letters, preserving the order in each group.
Note: The result should be printed to standard output (stdout).
## samplea1b2c3
abc123