l = []
for i in range(int(input())):
   l.append(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in l:
    if i == "AC":
        ac+=1
    if i == "TLE":
        tle+=1
    if i == "WA":
        wa+=1
    if i == "RE":
        re+=1
print("AC X "+str(ac))
print("WA X "+str(wa))
print("TLE X "+str(tle))
print("RE X "+str(re))
