n = int(intput())
a = []
for i in range(n):
  a.append(input())
print('AC x ' + str(a.count('AC')))
print('WA x ' + str(a.count('WA')))
print('TLE x ' + str(a.count('TLE')))
print('RE x ' + str(a.count('RE')))