Fire Control - 2#7109

Fire Control - 2

0.1 seconds
16 megabytes
Medium

In the context of the previous problem, where a message—an integer ranging from to 10^6—is encrypted by transmitting each digit, and then immediately repeating it as many times as its value, write a program to decrypt the message.

The program should return the original message if it has been received without errors, or if it cannot be restored.

Input

The input to the program is the received encrypted message , which is an integer (0 \le S < 10^{60}).

Output

The program should output the original message , which is an integer (0 \le P \le 10^6), or if the message cannot be accurately reconstructed.

Examples

Example 1

Loading
Loading