Wikipidia#3083

Wikipidia

1 second
256 megabytes
Very hard

This problem statement uses Cyrillic quotation marks «and» instead of "and" to avoid confusion with apostrophes used in the problem.

Ben is working on his new project, a non-traditional encyclopedia with the code name "Wikipidia". He needs to create an engine to convert wiki pages to HTML pages. However, he doesn't have enough time because he is busy promoting the project, so he hired you to write the engine.

At first, your engine must only support bold and italic formatting. In wiki, bold text is surrounded by three apostrophes («"' »), italic text is surrounded by two apostrophes («"»). In HTML, bold text is surrounded by b and /b, and italic text is surrounded by i and /i. In both wiki and HTML, the sequence of bold and italic start/end markers must be well-formed and non-recursive: if we replace the bold start marker with «(», the bold end marker with «)», the italic start marker with «[», and the italic end marker with «]», we must get a regular bracket sequence such that no round bracket is inside another round bracket, and no square bracket is inside another square bracket.

Unlike HTML, in wiki it is sometimes difficult to understand how to apply formatting, because sequences of or more apostrophes can be interpreted in different ways. However, your programming abilities are strong, so you must be able to write the translation engine.

Input

The input file contains one line representing a sample Wikipidia article, which contains only letters, punctuation marks («,», «.», «-», «?», «!»), spaces, and apostrophes used to denote bold/italic formatting. The input article size does not exceed bytes.

Output

Output the translated version of the article. The output file must not contain apostrophes.

To check your answer, the verifying program will ensure that the sequence of b, /b, i, and /i tags is well-formed and non-recursive, and will translate your output back to wiki by replacing b and /b with three apostrophes, and i and /i with two apostrophes. The result must match the input exactly.

If the input article cannot be translated correctly, output «!@#$%» instead.

Examples

Example 1

Loading
Loading