A cryptarithm replaces the digits of numbers in an arithmetic expression with letters. Different letters must represent different digits, and every occurrence of the same letter represents the same digit.
You are given the following equation consisting of strings:
Assign a distinct digit from to to every distinct letter so that the equation holds. The first digit of the number represented by any string must not be . Interpret each converted string as a decimal integer.
If multiple assignments exist, output any one of them.
The input is given in the following format:
If a valid one-to-one assignment exists, print decimal integers, one per line, corresponding to in this order.
Every string consists only of uppercase English letters.
If multiple answers exist, print any of them. If no assignment can satisfy the equation, print -1.