n = int(input())

j = list()
for _ in range(n):
    string = input()
    j.append(string)

ac = j.count("AC")
wa = j.count("WA")
tel = j.count("TEL")
re = j.count("RE")
print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tel))
print("RE x " + str(re))