n=int(input())
I={"ac":0,"wa":0,"tle":0,"re":0}
for i in n:
  I[input()]+=1
print("AC x {}".format(I["ac"]))
print("WA x {}".format(I["wa"]))
print("TLE x {}".format(I["tle"]))
print("RE x {}".format(I["re"]))
