n=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
  c=input()
  if c=='AC':
    ac+=1
  elif c=='WA':
    wa+=1
  elif c=='TLE':
    tle+=1
  else:
    re+=1

print("AC X {}".format(ac))
print("WA X {}".format(wa))
print("TLE X {}".format(tle))
print("RE X {}".format(re))