Puzzle of Numbers

No attempts yetTime limit1sMemory limit128 MB

Problem

An addition of two positive integers, A + B = C, is written out and then some of its digits are replaced by stars (*). The result is a number puzzle: a partially hidden addition.

For example, the equation

  9334
+  789
------
 10123

can be turned into puzzles such as

  *3*4       9**4       ****
+  78*     +  **9     +  ***
------     ------     ------
 10123      *****      *****

Given such a puzzle, reconstruct an addition that fits it. Each star may be replaced by any single digit, every fixed digit must stay unchanged, and the reconstructed A, B, and C must satisfy A + B = C.

It is guaranteed that every puzzle has at least one solution. In the reconstructed equation the leading digit of each number is never 0.

Input

The input consists of three lines. Each line is a string made of digits and stars (*) and is at most 20 characters long. The first two lines are the patterns of the two numbers being added, and the third line is the pattern of their sum.

Output

Print exactly three lines describing the reconstructed equation: the two addends on the first two lines and their sum on the third line. Each line must be a positive integer that matches the corresponding pattern, with no leading zero.

If more than one equation fits the puzzle, print the one whose first addend (line 1) is the smallest. If several equations still tie, print the one whose second addend (line 2) is the smallest.