Statement
Dadas is developing a debugging tool for a lightweight web browser. The browser's HTML parser has already read the document and constructed a DOM Tree, but the original HTML string was lost during debugging.
Fortunately, the structure of the DOM Tree and the information stored in each node remain intact. Dadas wants to traverse the tree from its root in the correct order and reconstruct a single HTML string that the browser can read again.
The figure below illustrates the relationship between a DOM Tree and its corresponding HTML string.
Relationship between a DOM Tree and HTML
In this problem, actual HTML syntax is simplified. Every node of the DOM Tree is exactly one of the following two types.
- Tag node: has one tag name and or more child nodes.
- Text node: contains one string and has no child nodes.
Consider a tag node whose tag name is x and whose child nodes, in order, are .
Its HTML representation is constructed by first writing the opening tag <x>, then concatenating the HTML representations of in the given order, and finally writing the closing tag .
A tag node with no children is not shortened. For example, if its tag name is p and it has no children, its HTML representation is always <p></p>.
The HTML representation of a text node is exactly the string stored in that node.
Attributes, escaping, comments, automatically inserted whitespace, self-closing tags, and other HTML features are not considered in this problem.
The root of the given DOM Tree is always node . Find the HTML representation of node .
Input
The input is given from Standard Input in the following format:
Output
For each test case, print the HTML representation of node on one line.
Constraints
- .
- for each test case.
- The sum of over all test cases does not exceed .
Subtasks
Samples
The first child of the h1 node is hello, and the second child is the p node numbered . Concatenating their representations in this order gives the sample output.