N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
    temp = input()
    if temp == "AC":
        AC = AC + 1
    if temp == "WA":
        WA = WA + 1
    if temp == "TLE":
        TLE = TLE + 1
    if temp == RE:
        RE = RE + 1
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))
