N = int(input())  # nは入力回数
S = [input() for _ in range(N)]

C_ac=0
C_wa=0
C_tle=0
C_re=0

for i in S:
    if i  == 'AC':
        C_ac = C_ac + 1 
    elif i  == 'WA':
        C_wa = C_wa + 1 
    elif i  == 'TLE':
        C_tle = C_tle + 1 
    elif i  == 'RA':
        C_ra = C_ra +1 
print("AC x "+str(C_ac))
print("WA x "+str(C_wa))
print("TLE x "+str(C_tle))
print("RE x "+str(C_re))