n = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for _ in range(n):
  a = input()
  if a = "AC":
    AC += 1
  elif a = "WA":
    WA += 1
  elif a = "TLE":
    TLE += 1
  else:
    RE += 1
  
print("AC x "+ AC)
print("WA x "+ WA)
print("TLE x "+ TLE)
print("RE x "+ RE)
