N = int(input())

r = []

for i in range(N):
  r = r + [input()]

ac = 0
wa = 0
tle = 0
re = 0

for j in r:
  if j == 'AC':
    ac += 1
  elif j == 'WA':
    wa += 1
  elif j == 'TLE':
    tle += 1
  elif j == 'RE':
    re += 1
print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)