from collections import Counter as ct

n = int(input())
s = ct([input() for _ in range(n)])
print("AC x " + str(s["AC"]))
print("WA x " + str(s["wA"]))
print("TLE x " + str(s["TLE"]))
print("RE x " + str(s["RE"]))