n=int(input())
a = [input() for i in range(n)]
A=str(a.count("AC"))
B=str(a.count("WA"))
C=str(a.count("TLE"))
D=str(a.count("RE"))
print("AC x"+ A)
print("WA x"+ B)
print("TLE x"+ C)
print("RE x"+ D)