import strutils,tables,sugar
let
 n=stdin.readline.parseInt
 s=lc[stdin.readline|(x<-1..n),string].toCountTable()
stdout.write("AC × "& $s["AC"]&"\n")
stdout.write("WA × "& $s["WA"]&"\n")
stdout.write("TLE × "& $s["TLE"]&"\n")
stdout.write("RE × "& $s["RE"]&"\n")
