n = int(eval(input()))

s = [eval(input()) for _ in range(n)]

print(('AC x', s.count('AC')))

print(('WA x', s.count('WA')))

print(('TLE x', s.count('TLE')))

print(('RE x', s.count('RE')))
n = int(eval(input()))

s = [eval(input()) for _ in range(n)]



t = ('AC', 'WA', 'TLE', 'RE')

for i in t:

    print((i, 'x', s.count(i)))
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
print(("AC x", s.count("AC")))
print(("WA x", s.count("WA")))
print(("TLE x", s.count("TLE")))
print(("RE x", s.count("RE")))

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
t = ("AC", "WA", "TLE", "RE")
for i in t:
    print((i, "x", s.count(i)))

-print(("AC x", s.count("AC"))) -print(("WA x", s.count("WA"))) -print(("TLE x", s.count("TLE"))) -print(("RE x", s.count("RE"))) +t = ("AC", "WA", "TLE", "RE") +for i in t: +    print((i, "x", s.count(i)))