#K12346. Compress String

    ID: 23670 Type: Default 1000ms 256MiB

Compress String

Compress String

You are given a string \(S\). Your task is to compress the string by replacing each group of consecutive identical characters with the character followed by the count of its occurrences. For example, the string 'aaabbbccc' becomes 'a3b3c3'.

However, if the length of the compressed string is not strictly less than the length of the original string, you should return the original string instead.

Note: The compression is computed as follows: For each maximal group of consecutive identical characters \(c\) which appears \(k\) times, it becomes \(c\,k\) (using the LaTeX format for mathematical expressions, e.g. \(k=\text{count}\)).

inputFormat

The input is given via standard input (stdin) as a single line containing the string \(S\). The string may be empty.

outputFormat

Output via standard output (stdout) a single line containing the compressed string if it is strictly shorter than the original string; otherwise, output the original string.

## sample
aabbcc
aabbcc