from collections import defaultdict
n=int(input())
dic=defaultdict(int)
for i in range(n):
    x=input()
    if x in dic:
        dic[x]+=1
    else:
        dic[x]=1
print("AC X",dic["AC"])
print("WA X",dic["WA"])
print("TLE X",dic["TLE"])
print("RE X",dic["RE"])
