n = int(input())
l = []
for i in range(n):
  l[i] = input()
a = 0
w = 0
t = 0
r = 0
for i in range(n):
  if l[i] == 'AC':
    a += 1
  elif l[i] == 'WA':
    w += 1
  elif l[i] == 'TLE':
    t += 1
  else:
    r += 1
print('AC x ' + a)
print('WA x ' + w)
print('TLE x ' + t)
print('RE x ' + r)