(let* ((n (read))
       (ans '(0 0 0 0)))
  (loop :for k :from 1 :upto n
        :for j := (read-line)
        :do(cond ((string= "AC" j) (incf (first ans)))
                 ((string= "WA" j) (incf (second ans)))
                 ((string= "TLE" j) (incf (third ans)))
                 ((string= "RE" j) (incf (cadddr ans)))))
  (mapcar (lambda (a b)
            (format t "~A x ~A~%" a b)) '("AC" "WA" "TLE" "RE") ans))