A poet-programmer decided to participate in a literary contest for programmers, where poems could be submitted in four languages: Assembly, Foxy, Lispy, and Prology. As a seasoned poet-programmer, he recognized only Assembly as a true language, so he chose to write his poem in it. He launched his trusty edit.com running on DOS 6.22 and set to work. Since he was a lazy programmer, he used macros everywhere, which greatly sped up his process of composing poetry thanks to his vast collection of templates, as with any seasoned poet-programmer.
The poem turned out wonderfully, but after consulting with a friend, the poet realized that most art appreciators would not be able to understand it. To convey the deeper meaning of his creation, he decided to sacrifice its form and get rid of macro definitions by performing macro substitution.
The problem was that a macro definition could contain other macro definitions. Also, the poet was fond of cyclic macro generation, which was reflected in his poems. Unwilling to ruin his work with his own hands, he asks you for help.
You are given a poem containing macro definitions. The formats for macro definitions are as follows (in both input and output files, each character '_' represents exactly one space):
Macro definition: #identificator_{[text]}
The identifier (macro name) consists of at most lowercase Latin letters. There is never a macro named rep.
Macro invocation: ##identificator_
Cyclic macro definition: #rep_n_{[text]}
is a non-negative integer (number of repetitions), with 0 \leq n \leq 100.
A block is a text inside curly braces. The entire poem is also a block. Blocks can contain other macro definitions and macro calls.
A macro definition is active for all subsequent text in the current block and any nested blocks unless a macro with the same name is defined in a nested block (in which case the inner definition takes precedence). There are never two macro definitions with the same name in a single block.
Recursive calls do not occur. Calls to undefined macros are ignored. Any macro calls that appear before their definitions in the poem are also considered undefined and ignored.
Print the revised poem text.
Example 1