n = (int)(input())
C_0 = 0
C_1 = 0
C_2 = 0
_C3 = 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 {}",C_0) #{}のところにC_0の値が出力される
print("WA x {}",C_1)
print("TLE x {}",C_2)
print("RE 