#C10294. String Compression

    ID: 39483 Type: Default 1000ms 256MiB

String Compression

String Compression

Given a string s, compress it by counting consecutive repeating characters. For example, if a character c appears consecutively n times, it should be replaced by c followed by n (in latex: \( c\,n \)). For instance, the string aabcccccaaa will be compressed as a2b1c5a3. Implement this compression technique.

inputFormat

The input is provided via stdin as a single line containing the string s (only alphabetical characters) that needs to be compressed.

outputFormat

Output the compressed string to stdout. The output format is exactly the compressed string with each character followed by the count of its consecutive occurrences.

## sample
aabcccccaaa
a2b1c5a3