(ns atcoder.abc173c)

(def result {:AC 0 :WA 0 :TLE 0 :RE 0})

(def n (read))

(defn inc-map [keyword {ac :AC wa :WA tle :TLE re :RE :as all}]
  (cond (= keyword :AC) {:AC (inc ac) :WA wa :TLE tle :RE re}
        (= keyword :WA) {:AC ac :WA (inc wa) :TLE tle :RE re}
        (= keyword :TLE) {:AC ac :WA wa :TLE (inc tle) :RE re}
        (= keyword :RE) {:AC ac :WA wa :TLE tle :RE (inc re)}))


(def out  (loop [cnt n
                 result result]
  (cond (= cnt 0) result
        :else (recur (dec cnt)
                     (inc-map (keyword (read)) result)))))

(println (format "AC x %d" (:AC out)))
(println (format "WA x %d" (:WA out)))
(println (format "TLE x %d" (:TLE out)))
(println (format "RE x %d" (:RE out)))