a = int(input())
s = []
for i in range(0,a) :
    d = input()
    s.append(d)
    

c1 = 0
c2 = 0
c3 = 0
c4 = 0

for i in range(0,len(s)) :
    if s[i] == "AC" :
        c1 += 1
    elif s[i] == "WA" :
        c2 += 1
    elif s[i] == "TLE" :
        c3 += 1
    elif s[i] == "RE" :
        c4 += 1
print("AC *",str(c1))
print("WA *",str(c2))
print("TLE *",str(c3))
print("RE *",str(c4))