N = int(input())
ac, tle, wa, re = 0

for i in range(n):
    s[i-1] = input()
    
    
    if s[i-1] =="AC":
        ac = ac+1
    elif s[i-1] =="TLE"
        tle = tle+1
    elif s[i-1] =="WA"
        wa = wa+1
    elif s[i-1] =="RE"
        re = re+1

print("AC x "+ac)
print("WA x "+wa)
print("TLE x "+tle)
print("RE x "+re)