import collections

judgement = []
while True:
  try:
    judgement.append(input())
  except:
    break

counter = collections.Counter(judgement)

n_ac = counter.get('AC', 0)
n_ma = counter.get('MA', 0)
n_tle = counter.get('TLE', 0)
n_re = counter.get('RE', 0)

print('AC x {}'.format(n_ac))
print('MA x {}'.format(n_ma))
print('TLE x {}'.format(n_tle))
print('RE x {}'.format(n_re))
