parseInt(x)=parse(Int, x)
parseMap(x::Array{SubString{String},1})=map(parseInt, x)

function main()
	n = readline() |> parseInt
	a = zeros(Int,4)
	for i in 1:n
		s = readline() |> chomp
		if s=="AC"
			a[1]+=1
		elseif s=="WA"
			a[2]+=1
		elseif s=="TLE"
			a[3]+=1
		else
			a[4]+=1
		end
	end
	println("AC x "+a[1])
	println("WA x "+a[2])
	println("TLE x "+a[3])
	println("RE x "+a[4])
end

main()