N=int(input())

for i in range(N):
	word = input()
    if word =="AC":
      AC+=1
    if word =="WA":
      WA+=1
    if word =="TLE":
      TLE+=1
    if word =="RE":
      RE+=1

print("AC x " +AC)
print("WA x " +WA)
print("TLE x " +TLE)
print("RE x " +RE)