N=int(input())

for i in range(0, N):
  val = input()
  if val:
    S.append(val)
AC=S.count('AC')
WA=S.count('WA')
TLE=S.count('TLE')
RE=S.count('RE')

print("AC x ", end='') 
print(AC)
print("WA x ", end='') 
print(WA)
print("TLE x ", end='') 
print(TLE)
print("RE x ", end='') 
print(RE)