module moduel1
  sub main()
    Dim N = Console.ReadLine()
    Dim i, S
    Dim ans(4) as Integer
    for i = 0 To N
    	S = Console.ReadLine()
    	ans(0) = ans(0) + (S = "AC")
    	ans(1) = ans(1) + (S = "WA")
    	ans(2) = ans(2) + (S = "TLE")
    	ans(3) = ans(3) + (S = "RE")
  	Next
  	
	Console.writeLine("AC x " & ans(0) & vbNewLine)
  	Console.writeLine("WA x " & ans(1) & vbNewLine)
  	Console.writeLine("TLE x " & ans(2) & vbNewLine)
  	Console.writeLine("RE x " & ans(3))
end sub
end module