def main():
  num = int(input())
  result = []
  for i in range(num):
    result.append(input())
  print(f'AC X {result.count("AC")}')
  print(f'WA X {result.count("WA")}')
  print(f'TLE X {result.count("TLE")}')
  print(f'RE X {result.count("RE")}')
  return

main()