"BOOM!!!!" Everyone was shocked when Sodium Mok threw an entire sodium metal into a pool of water. Sodium catches on fire and produced flames and exploded as sodium reacts with water to produce hydrogen gas which is highly flammable.

No one could believe what they saw. But you, the journey of you and chemistry, had just begun. "The power of chemistry," you thought, "I will become a successful chemist like Sodium Mok in the future!"

To plan ahead for your chemistry path, Sodium Mok assigned you a task. Given an the name of an compound, you need to write down its empirical formula. But you thought the task too trivial and boring, so you took up the challenge of generating the empirical formula by writing a program (which is perhaps more boring). (but you have to do it haha)

An ionic compound consists cations and anions. Cations carry a certain amount of positive charge, and anions carry a certain amount of negative charge. In a compound, the charges have balance each other out. For example, 2 aluminium $(Al^{3+})$ ions need to pair up with 3 oxide $(O^{2-})$ ions to form aluminium oxide $(Al_2O_3)$. The following table may help:

Note that charges without numbers means that they carry a single positive/negative charge.

Input

The only line of the input contains 2 string in lowercase letters separated by space, $P$ and $Q$. $P$ is the name of the cation, and $Q$ is the name of the anion.

Output

Output a string $A$, an integer $X$, a string $B$, and an integer $Y$, concatenated (not separated by spaces), where $A_X B_Y$ is the empirical formula of the compound. If $X$ is $1$, you do not need to output it. Similarly, if $Y$ is $1$, you do not need to output it. You should make sure $\gcd(X,Y)=1$. $A$ and $B$ are case sensitive.

Subtasks

In all test cases, $P$ is one of hydrogen, sodium, silver, potassium, lithium, barium, calcium, magnesium, zinc, lead or aluminium. $Q$ is one of chloride, bromide, fluoride, iodide, oxide, sulfide or nitride.
Subtask 1 (20%): the charge of $P$ is $+1$, and the charge of $Q$ is $-1$.
Subtask 2 (40%): the charge of $P$ is $+1$ or $+2$, and the charge of $Q$ is $-1$ or $-2$.
Subtask 3 (40%): no additional constraints

Sample Test Cases

Input Output
lithium chloride LiCl
One moles of lithum ions $(Li^+)$ and one mole of chloride ions $(Cl^-)$ combines to form one mole of lithium chloride $(LiCl)$.
aluminium sulfide Al2S3
Two moles of aluminium ions $(AL^{3+})$ and three moles of sulfide ions $(S^{2-})$ combines to form one mole of aluminium sulfide $(Al_2S_3)$.
barium chloride BaCl2
hydrogen sulfide H2S
aluminium fluoride AlF3
Click to copy.

Scoring: Per Subtask
Authored by s17r28
Appeared in 2022 Mini Contest 3 (Pre-HKOI Junior)