N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
while True:
    ia = input()
    if ia == "AC":
        ac += 1
    elif ia == "WA":
        wa += 1
    elif ia == "TLE":
        tle += 1
    elif ia == "RE":
        re += 1
    else:
        break

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)