ans = [0 for i in range (4)]
num = int(input())
for i in range (num):
    inp = input()
    if inp == 'AC':
        ans[0] += 1
    elif inp =='WA':
        ans[1] +=1
    elif inp == 'TLE':
        ans[2] += 1
    elif inp == 'RE':
        ans[3] += 1
    print(ans)
print ('AC x {}'.format(ans[0]))
print ('WA x {}'.format(ans[1]))
print ('TLE x {}'.format(ans[2]))
print ('RE x {}'.format(ans[3]))