c = int(input())
j =  [0]*4
for i in range(c):
  a = input()
  if a == "AC":
    j[0] += 1
  elif a == "WA":
    j[1] += 1
  elif a == "TLE":
    j[2] += 1
  else:
    j[3] += 1
    
print("AC × "+ str(j[0]))
print("WA × "+ str(j[1]))
print("TLE × "+ str(j[2]))
print("RE × "+ str(j[3]))

