arr = []
n = int(input())
while n > 0:
  arr.append(input())
  n -= 1
print('AC x '+arr.count('AC'))
print('WA x '+arr.count('WA'))
print('TLE x '+arr.count('TLE'))
print('RE x '+arr.count('RE'))
      