Module Module1

    Sub main()

        Dim userInput As String, userInput2 As String
        Dim result(4) As String

        Const RESULT_AC = "AC"
        Const RESULT_WA = "WA"
        Const RESULT_TLE = "TLE"
        Const RESULT_RE = "RE"

        userInput = Console.ReadLine()

        For i = 0 To 3
            result(i) = 0
        Next

        For i = 0 To CInt(userInput) - 1
            userInput2 = Console.ReadLine()

            Select Case userInput2
                Case RESULT_AC
                    result(0) = result(0) + 1
                Case RESULT_WA
                    result(1) = result(1) + 1
                Case RESULT_TLE
                    result(2) = result(2) + 1
                Case RESULT_RE
                    result(3) = result(3) + 1
            End Select
        Next

        Console.WriteLine(RESULT_AC & " x " & result(0))
        Console.WriteLine(RESULT_WA & " x " & result(1))
        Console.WriteLine(RESULT_TLE & " x " & result(2))
        Console.WriteLine(RESULT_RE & " x " & result(3))
    End Sub
end module