N = int(input())
S = [int(input()) for _ in range(N)]

AC = 0
WA = 0
TLE = 0
RE = 0

for i in S:
    if i == 'AC':
        AC += 1
    elif i == 'WA':
        WA += 1
    elif i == 'TLE':
        TLE += 1
    else:
        RE += 1
        
print('AC x', AC, '\n')
print('WA x', WA, '\n')
print('TLE x', TLE, '\n')
print('RE x', RE)
        