#K36967. Sort String by Character Type
Sort String by Character Type
Sort String by Character Type
You are given a string s consisting of alphabets and numbers. Your task is to sort this string so that all the alphabets appear first in their original order, followed by all the digits in their original order.
For example, if s = "a1b2c3d4", then the output should be "abcd1234".
Formally, let \( A \) be the subsequence of alphabets extracted from s in the order they appear, and let \( D \) be the subsequence of digits extracted from s in the order they appear. The required output is the concatenation \( A + D \).
inputFormat
The input consists of a single string s read from standard input. The string contains a mix of alphabets and digits.
Note: There are no spaces in the input string.
outputFormat
Output the transformed string to standard output such that all alphabets appear first (in their original order) followed by all digits (in their original order).
## samplea1b2c3d4
abcd1234