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