#C14519. Rearrange String
Rearrange String
Rearrange String
You are given a string s. Your task is to remove all non-alphanumeric characters from the string, and then rearrange it so that all letters come first (in their original order) followed by all digits (again in their original order).
In other words, if you denote the input string as \( s \), then you need to construct two sequences:
- \( L \): the sequence of all letters in \( s \) in the order they appear.
- \( D \): the sequence of all digits in \( s \) in the order they appear.
The final output should be the concatenation \( L+D \).
Note that non-alphanumeric characters should be ignored.
inputFormat
The input consists of a single line containing the string s. The string may include letters, digits, and special characters.
outputFormat
Output the rearranged string after removing non-alphanumeric characters and moving all digits to the end while preserving the original order of letters and digits.
## samplea1b2c3
abc123