n = int(input())

ac_counter = 0
wa_counter = 0
tle_counter = 0
re_counter = 0

for i in range(n):
  str = input()
  if str == "AC":
    ac_counter += 1
  elif str == "WA":
    wa_counter += 1
  elif str == "TLE":
    tle_counter += 1
  else :
    re_counter += 1
print("AC x "+str(ac_counter))
print("WA x "+str(wa_counter))
print("TLE x "+str(tle_counter))
print("RE x "+str(re_counter))