a = [input() for _ in range(int(input())]
print("AC x {0}".format(a.count("AC"))
print("WA x {0}".format(a.count("WA"))
print("TLE x {0}".format(a.count("TLE"))      
print("RE x {0}".format(a.count("RE"))