N=int(input())
s=""
for i in range(N):
    s.append(input())
print("AC x ".join(s.count("AC")))
print("WA x ".join(s.count("WA")))
print("TLE x ".join(s.count("TLE")))
print("RE x ".join(s.count("RE")))