dic=dict()
n=int(input())
for i in range(n):
    s=input()
    if s in dic:
        dic[s]+=1
    else:
        dic[s]=1
if "AC" in dic:
    print("AC *",dic["AC"])
else:
    print("AC * 0")
if "WA" in dic:
    print("WA *",dic["WA"])
else:
    print("WA * 0")
if "TLE" in dic:
    print("TLE *",dic["TLE"])
else:
    print("TLE * 0")
if "RE" in dic:
    print("RE *",dic["RE"])
else:
    print("RE * 0")
               
