n=int(input())
dic={}
dic["AC"]=0
dic["WA"]=0
dic["TLE"]=0
dic["RE"]=0
for x in range(n):
  a=input()
  dic[a]=dic[a]+1
print("AC",x,dic["AC"])
print("WA",x,dic["WA"])
print("TLE",x,dic["TLE"])
print("RE",x,dic["RE"])