N = int(input())
judge = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for i in range(N):
  judge[input()] += 1
print('AC X ' + str(judge['AC']))
print('WA X ' + str(judge['WA']))
print('TLE X ' + str(judge['TLE']))
print('RE X ' + str(judge['RE']))