N =int(input())
list ={"AC"=0, "WA"=0, "TLE"=0, "RE"=0 }
 
for i in range(N):
  words = input()
  list[words]+=1
 
print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))