13393 - Domo the Engineer   

Description

Domo is an engineer, he wants to zip the string and send it to his friends.

 

Given the sequence contain only English letter or digit, the runs of data(sequences in which the same data value occurs in many consecutive data elements) will be stored as a single data value and count, rather than as the original run.

 

Take sequence aaabbb444 for example, aaabbb444 can be encoded to 3a3b3'4'

Since there are 3 consecutive a, 3 consecutive b, and 3 consecutive '4' (separate the digit data and the digit count via the apostrophe).

 

When there are less than three consecutive "letters", do not compress it.

For example, aabbbdcccc should be encoded to aa3bd4c.

 

When there are non-consecutive "digits", simply store the digit, do not store the count.

For example, aabbb1ccc2dd33dd should be encoded to aa3b'1'3c'2'dd2'3'dd

 

Besides encoding, your friend is also interested in the compressing rate of the result, which is defined by

Compress Rate = (length of the encoded string) / (length of the original string).

 

Input

Given a sequence containing only English letters or digits.

(2  the length of the sequence  1000)

 

Output

Print out the zip string and the compression rate, both followed by a newline character.

If the compression rate is less than 1.0 then print out "Compress rate: X.XXX" with the result (round to the third digit after the decimal point), otherwise print out "The string can't zip".

You can use printf("Compress rate: %.3f\n", rate) for printing the result.

 

Sample Input  Download

Sample Output  Download

Tags

12



Discuss