n = int(input())
k = [input() for i in range(n)]
ac = 0
wa = 0
tle = 0
re = 0

for j in range(n):
  if k[j] == 'AC':
    ac += 1
  elif k[j] == 'WA':
    wa += 1
  elif k[j] == 'TLE':
    tle += 1
  elif k[j] == 'RE':
    re += 1
    
print("AC *",ac)
print("WA *",wa)
print("TLE *",tle)
print("RE *",re)