class kazoe:

    def __init__(self,b):
        b.sort()
        self.b = b
        print(self.b)

    def sum(self):
        c = [0] *4
        for i in range(len(self.b)):
            if(self.b[i] == "AC"):
                c[0] += 1
            else:
                if(self.b[i] == "TLE"):
                    c[1] += 1
                else:
                    if(self.b[i] == "WA"):
                        c[2] += 1
                    else:
                        c[3] += 1



        print('AC x',c[0])
        print('WA x',c[2])
        print('TLE x',c[1])
        print('RE x',c[3])


a = int(input())
b =[]
for i in range(a):
    b.append(input())

ans = kazoe(b)
ans.sum()