A popular form of pencil game is to use letters to represent digits in a mathematical statement. An example is
SEND
+MORE
-----
MONEY
which represents
9567
+1085
-----
10652
Your task is to read in sets of three "words" and assign unique digits to the letters in such a way as to make the sum of the first two words equal to the third word.
Input Specification
The input begins with a line containing a positive integer
Output Specification
The output is to consist of
Sample Input
2
SEND
MORE
MONEY
MEND
COPE
CONEY
Sample Output
9567
1085
10652
9567
1085
10652
ㅤ
Comments
Since the checker was not implemented properly, it was fixed, and all submissions were rejudged.
0 may not be the first digit of any number. (E.g. in the example with
, 
)