from collections import defaultdict

d=defaultdict(int)

for i in range(int(input())):
  s=input()
  d[s]+=1
  
print("AC x",d["AC"])
print("WA x",d["WA"])
print("TLE x",d["TLE"])
print("TLE x",d["TLE"])