n=int(input())
ans=[0,0,0,0]
for i in range(n):
  a=str(input())
  if a=="AC":
    ans[0]+=1
  elif a=="WA":
    ans[1]+=1
  elif a=="TLE":
    ans[2]+=1
  else:
    ans[3]+=0

print("AC x "+str(ans[0]))
print("WA x "+str(ans[1]))
print("TLE x "+str(ans[2]))
print("RE x "+str(ans[3]))
    