n = (int)(input())
C_0 = 0
C_1 = 0
C_2 = 0
C_3 = 0
for i in range(n):
    s = input()
    if s == "AC":
        C_0 += 1 #means C_0 = C_0 + 1
    if s == "WA":
        C_1 += 1
    if s == "TLE":
        C_2 += 1
    else:
        C_3 += 1

print('AC x {}'.format(C_0)) #{}のところにC_0の値が出力される
print('WA x {}'.format(C_1))
print('TLE x {}'.format(C_2))
print('RE x {}'.format(C_3))