You have to compute the value of “folding” a number.
“Folding” a number
is an operation shown in the following figure (open the PDF if you can’t
see the figure correctly on the Jutge web page).
In particular, any number can be considered a sequence of digits and be divided into two subsequences of consecutive digits and , be they of the same length, or alternatively of lengths differing only in one unit (including the case where or are empty). Concatenating these two halves and we would recover the original number .
Then, to compute the "folding" operation, we invert the order of the subsequence, which we will call , and, interpreting and as numbers once again, add them together to obtain the result of "folding".
As an example, if is 1234, the subsequence is 12 and is 34. Inverting the order of gives 21, and the result will be, then, .
In the case where has an odd length, the partition can be made in two different ways. For instance, if is 12345, we can compute the "folding" in these two ways:
Divide in and , and inverting and adding, we would get .
Divide in and , and inverting and adding, we would get .
The middle digit, then, ends up contributing in the same way to the final sum in both cases.
The input consists of a sequence of strictly positive integers.
The output consists of each number in the input “folded”
as explained, each one in a separate line.
Input
1 55 444 555 9901 12345 123456 9991001
Output
1 -> 1 55 -> 10 444 -> 48 555 -> 60 9901 -> 100 12345 -> 366 123456 -> 777 9991001 -> 2000