#C7881. String Compression

    ID: 51801 Type: Default 1000ms 256MiB

String Compression

String Compression

Given a string s consisting of ASCII characters, compress the string by replacing each group of consecutive identical characters with the character followed by the number of its occurrences. For example, the string aaabbccccd compresses to a3b2c4d1.

If the input string is empty, the output should also be an empty string.

More formally, if a character x appears consecutively k times, it should be replaced by the string x$\,k$ (using LaTeX format for formulas).

inputFormat

The input is provided via standard input (stdin) as a single line containing the string s.

outputFormat

Output the compressed string to standard output (stdout). For every group of consecutive identical characters, output the character followed by its count.

## sample
aaabbccccd
a3b2c4d1