n = int(input())
x = []
for i in range(n):
    x.append(raw_input())
print(x)

C0, C1, C2, C3 = 0, 0, 0, 0
for i in range(n):
    if x[i] == "AC":
        C0 += 1
    elif x[i] == "WA":
        C1 += 1
    elif x[i] == "TLE":
        C2 += 1
    else:
        C3 += 1

print("AC * " + str(C0))
print("WA * " + str(C1))
print("TLE * " + str(C2))
print("RE * " + str(C3))