N = int(input())
a = 0
w = 0
t = 0
r = 0
for i in range(N):
    S = input()
    if S == "AC":
        a += 1
    elif S == "WA":
        w += 1
    elif S == "TLE":
        t += 1
    elif S == "RE":
        r += 1
print("AC","x",a)
print("WA","x",w)
print("TLE","x",t)
print("RA","x",r)