#K59212. Reorder String: Digits Before Letters
Reorder String: Digits Before Letters
Reorder String: Digits Before Letters
Given a string s that contains digits and lowercase letters, reorder the string such that all digit characters appear before the letter characters. The relative order among the digits and among the letters must be preserved.
Formally, if the input string is given as:
[ s = c_1c_2\ldots c_n ]
where each character \( c_i \) is either a digit (\( 0-9 \)) or a lowercase letter (\( a-z \)), produce an output string where all digits come first (in the order they appear in \( s \)) followed by all letters (in the order they appear in \( s \)).
Input: A single string through standard input.
Output: The reordered string printed to standard output.
Example:
Input: a1b2c3d4 Output: 1234abcd
inputFormat
The input is read from standard input (stdin) and consists of a single line which contains a non-empty string composed of digits and lowercase letters.
outputFormat
Print the reordered string to standard output (stdout) where all digit characters appear before the letters, and the order is preserved as in the original input.
## samplea1b2c3d4
1234abcd