import re

regex_pattern = r'<a href="(.*?)".*?>([\w ,./]*)(?=</)'

for _ in range(int(input())):
    html = input()
    res = re.findall(regex_pattern, html)
    for link, title in res:
        print(f"{link},{title.strip()}")

e7a506c0dc31d2475fad7888cb72c506e0193d35
<mask token>

<mask token>
for _ in range(int(input())):
    html = input()
    res = re.findall(regex_pattern, html)
    for link, title in res:
        print(f'{link},{title.strip()}')

<mask token>
regex_pattern = '<a href="(.*?)".*?>([\\w ,./]*)(?=</)'
for _ in range(int(input())):
    html = input()
    res = re.findall(regex_pattern, html)
    for link, title in res:
        print(f'{link},{title.strip()}')

import re
regex_pattern = '<a href="(.*?)".*?>([\\w ,./]*)(?=</)'
for _ in range(int(input())):
    html = input()
    res = re.findall(regex_pattern, html)
    for link, title in res:
        print(f'{link},{title.strip()}')

import re

regex_pattern = r'<a href="(.*?)".*?>([\w ,./]*)(?=</)'

for _ in range(int(input())):
    html = input()
    res = re.findall(regex_pattern, html)
    for link, title in res:
        print(f"{link},{title.strip()}")
