N = int(input())

ac, wa, tle, re = 0, 0, 0, 0

for _ in []*N:
    S = int(input())
    if S == 'AC':
        ac+=1
    elif S == 'WA':
        wa+=1
    elif S == 'TLE':
        tle+=1
    elif S == 'RE':
        re+=1

print('AC x %d'%ac)
print('WA x %d'%wa)
print('TLE x %d'%tle)
print('RE x %d'%re)