nn = int(input())
ss = [input() for _ in range(nn)]

nac, nwa, nte, nre = 0, 0, 0, 0

for si in ss:
    if si == 'AC':
        nac += 1
    elif si == 'WA':
        nwa += 1
    elif si == 'TLE':
        nte += 1
    elif si == 'WA':
        nwa += 1
    else:
        pass

print('AC x ', nac)
print('WA x ', nwa)
print('TLE x ', nte)
print('RE x ', nre)

    
        

