listSi = [0,0,0,0]
i = int(input())
while (i = input()):
    if i == "AC":
        listSi[0] += 1
    elif i == "WA":
        listSi[1] += 1
    elif i == "TLE":
        listSi[2] += 1
    elif i == "RE":
        listSi[3] += 1
print("AC x {listSi[0]}")
print("WA x {listSi[1]}")
print("TLE x {listSi[2]}")
print("RE x {listSi[3]}")
