N = int(input())

l = []
for i in range(N):
    text = input()
    l.append(text)

print("AC" + " x " + str(l.count("AC")))
print("AC" + " x " + str(l.count("WA")))
print("TLE" + " x " + str(l.count("TLE")))
print("RE" + " x " + str(l.count("RE")))