n=int(input())
ac,wa,tl,re=0,0,0,0
for i in range(n):
  s=input()
  if(s=="AC"):
    ac+=1
  if(s=="WA"):
    wa+=1
  if(s=="TLE"):
    tl+=1
  else:
    re+=1
print("AC",'x',ac)
print("WA",'x',wa)
print("TLE",'x',tl)
print("RE",'x',re)
   