Imports System

Module Program
    Sub Main(args As String())

        Dim N As Integer = Console.ReadLine()

        Dim J(3) As Integer
        Dim s As String

        For i As Integer = 1 To N
            s = Console.ReadLine()
            Select Case s
                Case "AC"
                    J(0) += 1
                Case "WA"
                    J(1) += 1
                Case "TLE"
                    J(2) += 1
                Case "RE"
                    J(3) += 1
            End Select
        Next

        Console.WriteLine($"AC x {J(0)}")
        Console.WriteLine($"WA x {J(1)}")
        Console.WriteLine($"TLE x {J(2)}")
        Console.WriteLine($"RE x {J(3)}")

    End Sub

End Module
