Class Program
    Shared Sub Main(args As String())
        Dim n As Integer = CInt(Console.ReadLine())
        Dim s As New List(Of String)
        For i = 0 To n - 1
            s.Add(Console.ReadLine())
        Next
        Console.WriteLine("AC x " & s.Where(Function(x) x = "AC").Count())
        Console.WriteLine("WA x " & s.Where(Function(x) x = "WA").Count())
        Console.WriteLine("TLE x " & s.Where(Function(x) x = "TLE").Count())
        Console.WriteLine("RE x " & s.Where(Function(x) x = "RE").Count())
    End Sub
End Class