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