
def b():
    n = int(input())
    AC=0
    WA=0
    TLE=0
    RE=0
    while n:
        n-=1
        if input()=='AC':
            AC+=1
        elif input()=='WA':
            WA+=1
        elif input()=='TLE':
            TLE+=1
        else:
            RE+=1
    print("AC x %d"%AC)
    print("WA x %d"% WA)
    print("TLE x %d"% TLE)
    print("RE x %d"% RE)
b()

