n=int(input())
list_judge=[]
for i in range (n):
  list_judge.append(str(input()))

print("AC x ",acnum=list_judge.count("AC"))
print("WA x ",wanum=list_judge.count("WA"))
print("TLE x ",tlenum=list_judge.count("TLE"))
print("RE x ",renum=list_judge.count("RE"))