302. BHTML 1.0
Time limit per test: 0.25
Memory limit: 65536
The hypertext markup language BHTML 1.0 has only two paired tags. They are
tag capitalizes all letters inside its body (between an open tag and a close one), and
makes all inside the body letters lowercase. You are given the text consisting of latin letters and tags. Your task is to write the text right as it will be shown in the Bernet Explorer browser window. Tags in the text are arranged correctly, i.e. they form correct bracket sequence. If a letter lays inside several tags, its case is defined by the most inner tag.
The input contains the string S
with the text. The length of the string is a natural number not exceeding 1000. Tags are always written in uppercase.
Write to the output text after the processing.