a = []
N = int(input())
for i in range(N):
   s = input()
   a.append(s)

print("AC x {}".format(a.count("AC")))
print("TLE x {}".format(a.count("TLE")))
print("WA x {}".format(a.count("WA")))
print("RE x {}".format(a.count("RE")))