# https://www.hackerrank.com/challenges/detect-html-tags-attributes-and-attribute-values/problem


from html.parser import HTMLParser


class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print(tag)
        for attr in attrs:
            print(f"-> {attr[0]} > {attr[1]}")

    def handle_startendtag(self, tag, attrs):
        print(tag)
        for attr in attrs:
            print(f"-> {attr[0]} > {attr[1]}")


html = "\n".join([input() for _ in range(int(input()))])
# 9

# <head>
# <title>HTML</title>
# </head>
# <object type="application/x-flash"
#   data="your-file.swf"
#   width="0" height="0">
#   <!-- <param name="movie" value="your-file.swf" /> -->
#   <param name="quality" value="high"/>
# </object>

parser = MyHTMLParser()
parser.feed(html)
parser.close()
# head
# title
# object
# -> type > application/x-flash
# -> data > your-file.swf
# -> width > 0
# -> height > 0
# param
# -> name > quality
# -> value > high

# https://www.hackerrank.com/challenges/detect-html-tags-attributes-and-attribute-values/problem


from html.parser import HTMLParser


class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print(tag)
        for attr in attrs:
            print(f"-> {attr[0]} > {attr[1]}")

    def handle_startendtag(self, tag, attrs):
        print(tag)
        for attr in attrs:
            print(f"-> {attr[0]} > {attr[1]}")


html = "\n".join([input() for _ in range(int(input()))])
# 9

# <head>
# <title>HTML</title>
# </head>
# <object type="application/x-flash"
#   data="your-file.swf"
#   width="0" height="0">
#   <!-- <param name="movie" value="your-file.swf" /> -->
#   <param name="quality" value="high"/>
# </object>

parser = MyHTMLParser()
parser.feed(html)
parser.close()
# head
# title
# object
# -> type > application/x-flash
# -> data > your-file.swf
# -> width > 0
# -> height > 0
# param
# -> name > quality
# -> value > high

# https://www.hackerrank.com/challenges/detect-html-tags-attributes-and-attribute-values/problem # 9 # <head> # <title>HTML</title> # </head> # <object type="application/x-flash" #   data="your-file.swf" #   width="0" height="0"> #   <!-- <param name="movie" value="your-file.swf" /> --> #   <param name="quality" value="high"/> # </object> # head # title # object # -> type > application/x-flash # -> data > your-file.swf # -> width > 0 # -> height > 0 # param # -> name > quality # -> value > high