
Imports System.Console
Module Module1
    Dim n As Integer
    Sub Main()
        n = ReadLine()
        Dim r(n) As String
        For i = 1 To n
            r(i) = ReadLine()
        Next
        Dim AC, WA, TLE, RE As Integer
        For i = 1 To n
            Select Case r(i)
                Case "AC"
                    AC += 1
                Case "WA"
                    WA += 1
                Case "TLE"
                    TLE += 1
                Case "RE"
                    RE += 1
            End Select
        Next
        WriteLine("AC x " & AC)
        WriteLine("WA x " & WA)
        WriteLine("TLE x " & TLE)
        WriteLine("RE x " & RE)
    End Sub
End Module
