题目描述
Background
A big touch named Kurunie has appeared in the computer room! As a big touch, Kurunie naturally enjoys solving problems. However, with the NOIp finals approaching, Kurunie needs to allocate more time to practice OI problems, so it has handed over some simple problems to you.
Problem Description
Obviously, any problem is easy for Kurunie, but it's worried that you might not be able to solve them, so it has given you the simplest chemistry paper.
Kurunie is preparing for a chemical equation balancing competition, so the paper is full of balancing exercises.
Kurunie has given you a simple example, such as the chemical equation for the combustion of the following substances in oxygen, which needs to be balanced:

Kurunie knows that this is chlorogenic acid (C16H18O9) (make sure to distinguish between O and 0), and the equation for its combustion in oxygen is:
C16H18O9 + O2 = CO2 + H2O
What? You say balancing? Such a simple task is naturally left to you.
Input Format
A single line of string representing the chemical equation to be balanced. The reactants and products are separated by an equal sign, and substances are separated by plus signs. The numbers are inputted after the elements, as subscripts.
Output Format
A single line of string representing the balanced chemical equation. No precipitation or gas symbols are needed.
Sample Input and Output
Input Sample #1
C16H18O9+O2=CO2+H2O
Output Sample #1
C16H18O9+16O2=16CO2+9H2O
Input Sample #2
Cu(NO3)2+Fe=Fe(NO3)2+Cu
Output Sample #2
Cu(NO3)2+Fe=Fe(NO3)2+Cu
Notes
- The input string length is guaranteed to be less than or equal to 50, and the string contains only uppercase and lowercase English letters, numbers, parentheses, plus signs, and equal signs.
- The substances involved do not contain hydrated crystals.
- The elements involved have at most two letters.
- Parentheses do not nest within parentheses.
- After balancing, the coefficients of each substance and all subscripts in the original string are within the range of 32-bit signed integers.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分