Problem H. Hydrocarbons

Author:N. Grebenyuk. Translation: A. Logutova, V. Toropov.   Time limit:2 sec
Input file:Standard input   Memory limit:256 Mb
Output file:Standard output  

Statement

A group of scientists studied a sample of vanadium catalyst of new generation. It allows to form different linear hydrocarbons from gaseous mixture of carbon and hydrogen.

Hydrocarbon with a certain structure became the result of each scientists experiment. His formula was recorded by spectral analysis device as a linear line. However, such form of record is short. Therefore, scientists needed to transform this record to the full version.

The full version of any hydrocarbonic chain, received in this experiment, is formed by the following rules:

1. The hydrocarbonic chain is pictured as a linear sequence of carbons (pictured by symbol 'C'). The link between carbons can be single (pictured as '-') or double (pictured as '=').

2. Each carbon is connected with hydrogens by single links, to be tetravalent. This means that each carbon should have 4 links (double link is counted as two links):

 — first and last carbons are connected to form equal angles. Namely, if there are two hydrogens they are connected by diagonal links ('/', '\'). If there are three hydrogens they are connected by up ('|'), down ('|') and side ('-') links.

 — the rest of carbons: single hydrogen is connected by up link and two hydrogens are connected by up and down links.

Short version of hydrocarbonic chain looks like a sequence CHa1 CHa2...CHaN, where ai (2 ≤ ai ≤ 4) is a number of hydrogens with ith carbon. There is no number when it's only one hydrogen. And there is no 'H' symbol when carbon does not have any hydrogens.

Note that short record should have the same orientation as full record. Which means that the leftmost hydrocarbon in short record should match the leftmost hydrocarbon in full record.

Look carefully at sample tests for complete understanding.

Input format

First line contains a string with short version of hydrocarbonic chain.

It is guaranteed that given hydrocarbonic chain is correct.

Output format

Print 5 × (3 + 2 ⋅ N) characters, where N is the number of carbons in given chain.

All spaces not occupied by symbols of links or atoms should be filled with symbol '.'.

Constraints

1 ≤ N ≤ 10000

Sample tests

No. Standard input Standard output
1
CH4
..H..
..|..
H-C-H
..|..
..H..
2
CH2CH2
H.....H
.\.../.
..C=C..
./...\.
H.....H
3
CH3CH2CH2CH3
..H.H.H.H..
..|.|.|.|..
H-C-C-C-C-H
..|.|.|.|..
..H.H.H.H..
4
CH3CHCCH2
..H.H.....H
..|.|..../.
H-C-C=C=C..
..|......\.
..H.......H

0.211s 0.014s 13