from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
#####################################

n=int(input())
D=[0]*4
for i in  range(n):
    s=input()
    if s=="AC":
        D[0]+=1
    elif s=="WA":
        D[1]+=1
    elif s=="TLE":
        D[2]+=1
    else:
        D[3]+=1
print("AC X",D[0])
print("WA X",D[1])
print("TLE X",D[2])
print("RE X",D[3])
