number = int(input())

AC = 0
TLE = 0
WA = 0
RE = 0
chara = []
for i in range(0,number):
    a = input()
    if(a == 'AC'):
        AC = AC + 1
    elif(a == 'TLE'):
        TLE = TLE + 1
    elif (a == 'WA'):
        WA = WA + 1
    elif (a == 'RE'):
        RE = RE + 1

print('AC x ',AC)
print('TLE x ',TLE)
print('WA x ',WA)
print('RE x ',RE)