local n=io.read("n","l")
local s={}
for i=1,n do
    local input=io.read()
    s[input]=(s[input] or 0)+1
end

print("AC x "..(s["AC"] or 0))
print("WA x "..(s["WA"] or 0))
print("TLE x "..(s["TLE"] or 0))
print("RE x "..(s["RE"] or 0))