N = int(input())
C0 = 0
C1 = 0
C2 = 0
C3 = 0
for i in range(N):
    if input() = "AC":
        C0 += 1
    elif input() = "WA":
        C1 += 1
    elif input() = "TLE":
        C2 += 1
    else:
        C3 += 1
print("AC x " + C0)
print("WA x " + C1)
print("TLE x " + C2)
print("RE x " + C3)