N = int(input())
G0, G1, G2, G3 = 0, 0, 0, 0
for i in range(N):
    Si=input()
    if Si == 'AC':
        G0 += 1

    elif Si=='WA':
        G1 += 1

    elif Si=='TLE':
        G2 += 1
    
    else:
        G3 += 1
 
print('AC x' +str(G0))
print('WA x' +str(G1))
print('TLE x'+str(G2))
print('RE x' +str(G3))