n=int(input())
c=[0 for i in range(4)]
for i in range(n):
  s=input()
  if s=="AC":
    c[0]+=1
  if s=="WA":
    c[1]+=1
  if s=="TLE":
    c[2]+=1
  if s=="RE":
    c[3]+=1

print("AC x ",c[0])
print("WA x ",c[1])
print("TLEW x ",c[2])
print("RE x ",c[3])