N = int(input())
Ss = [input() for _ in range(N)]

import collections

c = collections.Counter(Ss)
print(c)
print("AC x " + str(c["AC"]))
print("WA x " + str(c["WA"]))
print("TLE x " + str(c["TLE"]))
print("RE x " + str(c["RE"]))