#P9782. [HUSTFC 2023] A+B problem

[HUSTFC 2023] A+B problem

Problem Description

Walk Alone is a string master. In his eyes, every string represents a base 2626 number. Specifically, in alphabetical order, AA to ZZ correspond to 00 to 2525 in decimal. Then BABA corresponds to 26 (1×26+0)26\ (1\times 26+0) in decimal, BBBB corresponds to 27 (1×26+1)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 ss and tt. Please compute the sum of the base 2626 numbers they represent, that is, s+ts+t, and tell him the result in string form as well. For example, A+A=AA+A=A, and B+C=DB+C=D. To simplify the problem, ss and tt 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 ss and tt.

Output Format

Output one line containing a string of uppercase letters, representing s+ts+t. The output must not contain leading 00, so outputs like AAAA and ABAB are invalid.

A A

A

B C

D

Z B

BA

Hint

Translated by ChatGPT 5