N = int(input())
S = [input() for i in range(N)]
res = [0,0,0,0]
for x in S:
    if x=="AC":
        res[0] +=1
    elif x == "WA":
        res[1] +=1
    elif x == "TLE":
        res[2] +=1
    else:
        res[3] +=1
print("AC × " + str(res[0]))
print("WA × " + str(res[1]))
print("TLE × " + str(res[2]))
print("RE × " + str(res[3]))
