N = int(input())
value = []
for i in N:
  value.append(int(input()))
ac = 0
wa = 0
tle = 0
re = 0
for a in value:
  if a == "AC":
    ac += 1
  elif a == "WA":
    wa += 1
  elif b == "TLE":
    tle += 1
  else:
    re += 1
print(f"AC x {ac}")
print(f"WA x {wa}")
print(f"TLE x {tle}")
print(f"RE x {re}")