n = int(input())

a = 0
w = 0
t = 0
r = 0

for i in range(n):
    b = input()
    if b == "AC":
        a += 1
    if b == "WA":
        w += 1
    if b == "TLE":
        t += 1
    if b == "RE":
        r += 1
print("AC x", a)
print("WA x", w)
print("TLE x", t)
print("RE2 x", r)


