#C4775. Reorder String

    ID: 48350 Type: Default 1000ms 256MiB

Reorder String

Reorder String

Given an input string (s) consisting of letters and digits, reorder the string such that all letters come first followed by all digits. The relative order among letters and among digits must be preserved.

For example, for an input of a1b2c3, the output should be abc123.

In mathematical terms, if (s = s_1s_2\ldots s_n), let L be the subsequence of letters and D be the subsequence of digits (both preserving their original order). The answer is the concatenation (L||D).

inputFormat

A single line containing the string (s).

outputFormat

Output the reordered string.## sample

a1b2c3
abc123