n=int(input())
m={"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(n):
  s=input() 
  if s=="AC":
    m[s]+=1
  elif s=="WA":
    m[s]+=1 
  elif s=="RE":
    m[s]+=1
  elif s=="TLE":
    m[s]+=1
print("AC X",m["AC"])
print("WA X",m["WA"])
print("TLE X",m["TLE"])
print("RE ",m["RE"])