n = int(input())
s = [input() for i in range(n)]
lst0 = []
lst1 = []
lst2 = []
lst3 = []
for i in range(n):
    if s[i] == 'AC':
        lst0.append(s[i])
    elif s[i] == 'WA':
        lst1.append(s[i])
    elif s[i] == 'TLE':
        lst2.append(s[i])
    else:
        lst3.append(s[i])
print(f'AC × {len(lst0)}')
print(f'WA × {len(lst1)}')
print(f'TLE × {len(lst2)}')
print(f'RE × {len(lst3)}')