from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())
    li=[0]*4
    for i in range(n):
        tmp=readline().strip()
        if tmp=="AC":
            li[0]+=1
        elif tmp=="WA":
            li[1]+=1
        elif tmp=="TLE":
            li[2]+=1
        elif tmp=="RE":
            li[3]+=1
    
    for i in range(4):
        if i==0:
            print("AC x {}",li[0])
        elif i==1:
            print("WA x {}",li[1])
        elif i==2:
            print("TLE x {}",li[2])
        elif i==3:
            print("RE x {}",li[3])

if __name__=="__main__":
    main()