Cryptogram
Create a program that deciphers an addition expression where all addends are separated by the '+' sign, and the sum is preceded by the '=' sign. The expression is encoded such that:
Identical digits are replaced by identical letters.
Different digits are replaced by different letters.
Uppercase and lowercase letters are distinct.
Both Latin and Cyrillic letters may be used.
The number of addends does not exceed 9, and each addend contains between 2 and 9 digits.
Input
The first line contains a natural number representing the base of the numeral system, which ranges from 5 to 10 inclusive. The second line contains the encoded addition expression. There are no additional spaces separating the addends, the sum, or the '+' and '=' signs.
Output
Output all possible ways to decipher the given addition expression, with each solution on a new line and without repetition. The order of the solutions does not matter.