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
end

for k,v in pairs(_map) do
	outstr = outstr .. k .. " x " .. v .. "\n"
end
print(outstr)