import re while 1:print re.sub("<(del|s|st.+?)>(.+?)",lambda m:m.group(2)+"^H"*len(m.group(2)),raw_input())