n = int(input())
s = list(map(int, input().split()))

  if s == "AC":
    a = sum(s)
  elif s== "WA":
    w = sum(s)
  elif s== "TLE":
    t = sum(s)
  else:
    e = sum(s)
  
  print("AC × ",a)
  print("WA × ",w)
  print("TLE × ",t)
  print("RE × ",r)