result = []
for _ in range(int(input())):
  result.append(input())
print("AC X {}".format(result.count("AC")))
print("WA X {}".format(result.count("WA")))
print("TLE X {}".format(result.count("TLE")))
print("RE X {}".format(result.count("RE")))

      