N = int(input())

import collections
l = []
for n in range(N):
  S = input()
  l.append(S)

c = collections.Counter(l)


print("AC x " c['AC'])
print("WA x " c['WA'])
print("TLE x " c['TLE'])
print("RE x " c['RE'])