s = []
n = int(input())
for i in range(n):
    s.append(input())
print("AC x " + str(s.count("AC")))
print("WA x " + str(s.count("WA")))
print("TlE x " + str(s.count("TLE")))
print("RE x " + str(s.count("RE")))