AC = 0
WA = 0
TLE = 0
RE = 0
count = int(input())
for i in range count:
  out = input()
  if out == 'AC':
    AC += 1
  elif out == 'WA':
    WA += 1
  elif out == 'TLE':
    TLE += 1
  else:
    RE += 1
print('AC x '+ str(AC))
print('WA x '+ str(WA))
print('TLE x '+ str(TLE))
print('RE x '+ str(RE))
