from collections import Counter



n = int(eval(input()))

verdict = list()

while n:

    n -= 1

    verdict.append(eval(input()))



dictOBJ = dict()

dictOBJ = { 'AC' : 0, 'WA' : 0, 'TLE' : 0, 'RE' : 0}

for elm in verdict:

    dictOBJ[elm] += 1



print(('AC x', dictOBJ['AC']))

print(('WA x', dictOBJ['WA']))

print(('TLE x', dictOBJ['TLE']))

print(('RE x',dictOBJ['RE']))

"""

atcoder : 173B

auther : Jay Saha

handel : ponder2000

date : 15/07/2020

"""



ans = {

    "AC": 0,

    "WA": 0,

    "TLE": 0,

    "RE":0

}



n = int(eval(input()))

for _ in range(n):

    ans[eval(input())] += 1

print(f"AC x {ans['AC']}")

print(f"WA x {ans['WA']}")

print(f"TLE x {ans['TLE']}")

print(f"RE x {ans['RE']}")
from collections import Counter

n = int(eval(input()))
verdict = list()
while n:
    n -= 1
    verdict.append(eval(input()))
dictOBJ = dict()
dictOBJ = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for elm in verdict:
    dictOBJ[elm] += 1
print(("AC x", dictOBJ["AC"]))
print(("WA x", dictOBJ["WA"]))
print(("TLE x", dictOBJ["TLE"]))
print(("RE x", dictOBJ["RE"]))

"""
atcoder : 173B
auther : Jay Saha
handel : ponder2000
date : 15/07/2020
"""
ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
n = int(eval(input()))
for _ in range(n):
    ans[eval(input())] += 1
print(f"AC x {ans['AC']}")
print(f"WA x {ans['WA']}")
print(f"TLE x {ans['TLE']}")
print(f"RE x {ans['RE']}")

-from collections import Counter - +""" +atcoder : 173B +auther : Jay Saha +handel : ponder2000 +date : 15/07/2020 +""" +ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0} -verdict = list() -while n: -    n -= 1 -    verdict.append(eval(input())) -dictOBJ = dict() -dictOBJ = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0} -for elm in verdict: -    dictOBJ[elm] += 1 -print(("AC x", dictOBJ["AC"])) -print(("WA x", dictOBJ["WA"])) -print(("TLE x", dictOBJ["TLE"])) -print(("RE x", dictOBJ["RE"])) +for _ in range(n): +    ans[eval(input())] += 1 +print(f"AC x {ans['AC']}") +print(f"WA x {ans['WA']}") +print(f"TLE x {ans['TLE']}") +print(f"RE x {ans['RE']}")