N = int(input())
A = 0
W = 0
T = 0
R = 0
for i in range(1, N+1):
  s = str(input())
  if s == "AC":
    A = A + 1
  elif s == "WA":
    W = W + 1
  elif s == "TLE":
    T = T + 1
  elif s == "RE":
    R = R + 1
  print("AC x " + str(A))
  print("WA x " + str(W))
  print("TLE x " + str(T))
  print("RE x " + str(R))
  
  