N = int(input())
i = 0
C0 = 0
C1 = 0
C2 = 0
C3 = 0
while (i < N):
  i += 1
  S = input()
  if(S == "AC"):
    C0 += 1
  elif(S == "WA"):
    C1 += 1
  elif(S == "TLE"):
    C2 += 1
  else:
    C3 += 1

print("AC x " +  str(C0))
print("WA × " +  str(C1))
print("TLE × " +  str(C2))
print("RE × " +  str(C3))