import collections

n = int(input())
case = list(input() for _ in range(n))

cn = collections.Counter(case)
print(cn)

print("AC x " + str(cn["AC"]))
print("WA x " + str(cn["WA"]))
print("TLE x " + str(cn["TLE"]))
print("RE x " + str(cn["RE"]))
