n = int(input())
AC=0
WA=0
TLE=0
RE=0
list1 = []
for _ in range(n):
    s = input()
    list1.append(s)

for i in list1:
    if(i=='AC'):    AC+=1
    elif(i=='WA'):  WA+=1
    elif(i=="TLE"): TLE+=1
    else:
        RE+=1

print("AC x",AC )
print("WA x",WA )
print("TLE x",TLE )
print("Re x",RE )