count = input()
a = 0
b = 0
c = 0
d = 0
while count:
    val = input()
    if val == 'AC':
        a += 1
    elif val == 'WA':
        b += 1
    elif val == 'TLE':
        c +=1
    elif val == 'RE':
        d+=1
    count -= 1

print('AC x ' + str(a))
print('WA x ' + str(b))
print('TLE x ' + str(c))
print('RE x ' + str(d))