Folding#5179

Folding

1 second
64 megabytes
Very easy

Bill is trying to compactly represent sequences consisting of capital Latin letters from A to Z by folding repeating subsequences within them. For example, one way to represent the sequence AAAAAAAAAABABABCCD is 10(A)2(BA)B2(C)D. He formally defines folded sequences of characters, along with the corresponding unfolding transformation, as follows:

According to this definition, it is easy to unfold any given folded sequence. However, Bill is more interested in the reverse transformation. He wants to fold the given sequence such that the resulting folded sequence contains the least possible number of characters.

Input

The input consists of a single line containing between and capital Latin letters (A–Z).

Output

Output a single line containing the shortest possible folded sequence that unfolds to the given input sequence. If there are several answers, output any one of them.

Examples

Example 1

Loading
Loading