n=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
  s=input()
  if s=='ac':
    ac+=1
  elif s=='wa':
    wa+=1
  elif s=='tle':
    tle+=1
  else:
    re+=1
print("AC x %s"%ac)
print("WA x %s"%wa)
print("TLE x %s"%tle)
print("RE x %s"%re)
