N = int(input())
AC = 0
WA = 0
TLE =0
RE = 0
i = 0
while(i<N):
  S = input()
  if S == "AC":
    AC +=1
  elif S == "WA":
    WA += 1
  elif S == "TLE":
    TLE += 1
  elif S == "RE":
  	RE += 1
  i +=1
print("AC X ",AC)
print("WA X ",WA)
print("TLE X ",TLE)
print("RE X ",RE)