n = int(input())
a = 0
b = 0
c = 0
d = 0

for i in range(n):
  S = list(map(str, input().split()))
  if S[0] == 'AC':
    a += 1
  if S[0] == 'WA':
    b += 1
  if S[0] == 'TLE':
    c += 1
  if S[0] == 'RE':
    d += 1
print('AC × '+str(a))
print('WA × '+str(b))
print('TLE × '+str(c))
print('RE × '+str(d))
