Bill is trying to compactly represent sequences of capital alphabetic characters from to by folding repeating subsequences inside 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 unfolding transformation for them in the following way:
- A sequence that contains a single character from to is considered to be a folded sequence. Unfolding this sequence produces the same single character itself.
- If and are folded sequences, then is also a folded sequence. If unfolds to S' and unfolds to Q', then unfolds to S'Q'.
- If is a folded sequence, then is also a folded sequence, where is a decimal representation of an integer number greater than . If unfolds to S', then unfolds to S' repeated times.
According to this definition, it is easy to unfold any given folded sequence. However, Bill is much more interested in the reverse transformation. He wants to fold the given sequence in such a way that the resulting folded sequence contains the fewest possible number of characters.
The input file contains a single line of characters from to with at least and at most characters.
Write to the output file a single line that contains the shortest possible folded sequence that unfolds to the sequence given in the input file. If there are multiple such sequences, then write any one of them.
Example 1