local s = io.read()
local num = tonumber(s)
local outstr = ""

local map = {
	["AC"] = 0,
	["WA"] = 0,
	["TLE"] = 0,
	["RE"] = 0,
}

for i=1,num do
	s = io.read()
	if map[s] then
		map[s] = map[s] + 1
	end
	for k,v in pairs(map) do
		outstr = outstr .. k .. " x " .. v .. "\n"
	end
end

print(outstr)