N = int(input())
S = []
for x in range(N):
  S.append(input())

# print(S)
L = 0
K = 0
J = 0
H = 0
for i in range(N):
  if S[i] == "AC":
    L += 1    
  if S[i] == "WA":
    K += 1 
  if S[i] == "TLE":
    J += 1
  if S[i] == "RE":
    H += 0
print("AC x "+str(L))  
print("WA x "+str(K))
print("TLE x "+str(J))
print("RE x "+str(H))