from collections import defaultdict
n = int(input())
d = defaultdict(int)
d['AC'] = 0
d['RE'] = 0
d['TLE'] = 0
d['WA'] = 0
for _ in range(n):
  s = input()
  d[s] += 1
for x in d:
  print(x, 'X', d[x])