n = int(input())
s = list(input() for i in range(n))
a = s.count("AC")
w = s.count("WA")
t = s.count("TLE")
r = s.count("RE")

print("AC x " + str(a))
print("WA x " + str(w))
print("TLE x " + str(t))
print("RE x " + str(r