n = int(input())
c0 = c1 = c2 = c3 = 0
for _ in range(n):
  s = input()
  if s == "AC":
    c0 += 1
  elif s == "WA":
    c1 += 1
  elif s == "TLE":
    c2 += 1
  else
  	c3 += 1

print("AC x", c0, sep = " ")
print("WA x", c1, sep = " ")
print("TLE x", c2, sep = " ")
print("RE x", c3, sep = " ")
