cho.sh
Notes
Loading...

Restore an Addition Equation

Time limit

2s

Memory limit

128 MB

Problem

An addition equation has the form A+B=C. The values A, B, and C are nonnegative integers. A number may not start with 0, unless the number has exactly one digit. Some digits in the equation are written as ?.

Restore the equation by replacing every ? with a digit so that the equation is true. If several restorations are possible, output one with the largest value of C. If there is still more than one, output one with the largest value of A.

Input

The first line contains the equation. Its length is at most 50 characters.

Output

Print the restored equation. If it is impossible, print -1.