# Fast IO (only use in integer input) or take care about string

import os,io
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0

for _ in range(N):
  str = input()
  if str[0] == 'A':
    AC += 1
  elif str[0] == 'W':
    WA += 1
  elif str[0] == 'T':
    TLE += 1
  elif str[0] == 'R':
    RE += 1
print('AC x ' + str(AC))
print('WA x ' + str(WA))
print('TLE x ' + str(TLE))
print('RE x ' + str(RE))