Beautiful numbers#2225

Beautiful numbers

1 second
128 megabytes
Medium

You probably noticed that many companies use "beautiful" phone numbers for advertising that are easy for potential customers to remember. But what if your company's number is unremarkable? You can take a closer look at it, and maybe, if you regroup the digits in some way, the number will become much more attractive. For example, if your company has the number 872-73-33, then it can be made more beautiful if you regroup the digits like this: 8727-333.

Let us define the beauty of a partition of the number. We will break the number with hyphens into groups of to digits. The beauty of a partition is the sum of the points assigned to each group as specified in the following table.

prb2225.gif

In this table, the symbols "a", "b", and "c" denote different digits. For example, the groups "223" and "667" fit the template "aab", but "123" and "888" do not.

Using this evaluation, find the partition of the given number with the highest beauty.

Input

Contains one line of digits — the given phone number.

Output

Print the partition of the number with the maximum beauty on the first line, and its beauty value on the second line. If there are several partitions with the same maximum beauty, output any one of them.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading