4956: P8324 [COCI2021-2022#5] Kemija(普及-)
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description

Input

Output

Sample Input Copy
3
A+B->AB
AB+CD->AC+DB
AB+B->AB
Sample Output Copy
DA
DA
NE
HINT
