n = int(input())
ac,wa,tle,re = 0,0,0,0
for i in range(n):
    inp = input()
    if inp == 'AC':
        ac += 1
    elif inp == 'WA':
        wa += 1
    elif inp == 'TLE':
        tle += 1
    else :
        RE += 1



print('AC x {}\nWA x {}\nTLE x {}\nRE x {}'.format(ac,wa,tle,re))