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