
N = int(input())
AC,WA,RE,TLE = 0,0,0,0
for i in range(N):
    result = input()
    if result == "AC":
        AC += 1
    elif result == "WA":
        WA += 1
    elif result == "RE":
        RE += 1
    else:
        TLE += 1

print("AC x " + str(AC))
print("WA x " + str(WA))
print("RE x " + str(RE))
print("TLE x " + str(TLE))