n = int(input())
c0, c1, c2, c3 = [0 for i in range(4)]
for j in range(n):
  judge = input()
  c0 += 1 if judge == "AC" else c1 += 1 if judge == "WA" else c2 += 1 if judge == "TLE" else c3 += 1

print("AC x " + str(c0))
print("WA x " + str(c1))
print("TLE x " + str(c2))
print("RE x " + str(c3))