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.
The input to the program is the received encrypted message , which is an integer (0 \le S < 10^{60}).
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.
Example 1