N = int(input())

i = 1
AC = 0
WA = 0
TLE = 0
RE = 0
list = []
for i in range(N):
    list.append(str(input()))
    a = list.count("AC")
    b = list.count("WA")
    c = list.count("TLE")
    d = list.count("RE")

print("AC x",str(a))
print("WA x" , str(b))
print("TLE x" , str(c))
print("RE x" ,str(d))
