N = int(input())
S = [0]*N
AC = 0
WA = 0
TLE = 0
RE = 0

for n in range(N):
  S[n] = input()
  if S[n] == "AC":
    AC += AC
  elif S[n] == "WA":
    WA += WA
  elif S[n] == "TLE":
    TLE += TLE
  elif S[n] == "RE":
    RE += RE
    
print("AC x {}\nWA x {}\nTLE x {}\nRE x {}".format(AC,WA,TLE,RE))