n=int(input())
s=[input() for _ in range(n)]
c0=0
c1=0
c2=0
c3=0
for i in s:
  if i=="AC":
    c0+=1
  elif i=="WA":
    c1+=1
  elif i=="TLE":
    c2+=1
  elif i=="RE":
    c3+=1
print("AC"+" "+"×"+" "+str(c0))
print("WA"+" "+"×"+" "+str(c1))
print("TLE"+" "+"×"+" "+str(c2))
print("RE"+" "+"×"+" "+str(c3))
  