Problem A: Crypto-Math

Each input instance will begin with a number, N, indicating the number of different letters used in the math problem. A value of N=0 will indicate the end of input. On the next line will be the problem, in the form (for example): AAB + BCD = CDE. ................
................