count1=0
count2=0
count3=0
count4=0
N=int(input())
for i in range(N):
  A=input()
  if A=="AC":
    count1=count1+1
  elif A=="WA":
    count2=count2+1
  elif A=="TLE":
    count3=count2+1
  elif A=="RE":
    count4=count2+1
print("AC x "+str(count1))
print("WA x "+str(count2))
print("TLE x "+str(count3))
print("RE x "+str(count4))
  