ac=0
wa=0
tle=0
re=0
n=int(input())
for _ in range(n):
  x=input()
  if x=='AC':
    ac+=1
  elif x=='WA':
    wa+=1
  elif x=='TLE':
    tle+=1
  elif x=='RE':
    RE+=1
print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)