list = []
N = int(input())
list = [input() for i in range(N)]
print("AC X " + str(list.count("AC")))
print("WA X " + str(list.count("WA"))) 
print("TLE X " + str(list.count("TLE")))
print("RE X " + str(list.count("RE"))) 