P9782 [HUSTFC 2023] A+B problem

Description

Walk Alone is a string master. In his eyes, every string represents a base $26$ number. Specifically, in alphabetical order, $A$ to $Z$ correspond to $0$ to $25$ in decimal. Then $BA$ corresponds to $26\ (1\times 26+0)$ in decimal, $BB$ corresponds to $27\ (1\times 26+1)$ in decimal, and so on. Walk Alone wants to test you, who are already used to decimal addition. He gives you two strings $s$ and $t$. Please compute the sum of the base $26$ numbers they represent, that is, $s+t$, and tell him the result in string form as well. For example, $A+A=A$, and $B+C=D$. To simplify the problem, $s$ and $t$ each contain only one uppercase letter, but note that the answer may contain more than one uppercase letter.

Input Format

One line contains two uppercase letters separated by a space, representing $s$ and $t$.

Output Format

Output one line containing a string of uppercase letters, representing $s+t$. The output must not contain leading $0$, so outputs like $AA$ and $AB$ are invalid.

Explanation/Hint

Translated by ChatGPT 5