n=int(input())
ans=[0]*4
for i in range(n):
  s=input()
  if s=='AC':
    ans[0]+=1
  elif s=='WA':
    ans[1]+=1
  elif s=='TLE':
    ans[2]+=1
  else:
    ans[3]+=1
for i in range(4):
  print("AC x "+str(ans[i]))