N = int(input())

c0 = 0
c1 = 0
c2 = 0
c3 = 0

for _ in range(N):
  c = input()
  if c == 'AC':
    c0 += 1
  elif c == 'WA':
    c1 += 1
  elif c == 'LTE':
    c2 += 1
  elif c == 'RE':
    c3 += 1
    
print('AC x ' + str(c0))
print('WA x ' + str(c1))
print('LTE x ' + str(c2))
print('RE x ' + str(c3))
