N=int(input())
AC=0
WA=0
TLE=0
RE=0
 
for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  elif K=="WA":
    WA=WA+1
  elif K=="TLE":
    TLE=TLE+1
  else:
    RE=RE+1
 
print("AC x " + AC)
print("WA x " + RE)
print("TLE x " + TLE)
print("RE x " + RE)