Module Module1

    Sub Main()
        Dim readline As String
        Dim len As Integer = 0
        Dim hogehoge() As String

        len = CType(Console.ReadLine(), Integer)

        Dim wasawasa(len - 1) As String
        For i As Integer = 0 To len - 1
            wasawasa(i) = Console.ReadLine()
        Next



        For Each ans As String In check(wasawasa)
            Console.WriteLine(ans)
        Next


        Console.ReadKey()

    End Sub


    Private Function check(ByVal hogehoge As String()) As List(Of String)
        Dim returnlist As New List(Of String)

        Array.Sort(hogehoge)

        Dim counter As Integer = 0
        Dim maxcount As Integer = 0
        Dim prevstr As String = hogehoge(0)
        For Each str As String In hogehoge
            If prevstr <> str Then
                If counter < maxcount Then
                    counter = 0
                ElseIf counter = maxcount Then
                    returnlist.Add(prevstr)
                ElseIf counter > maxcount Then
                    maxcount = counter
                    returnlist.Clear()
                    returnlist.Add(prevstr)
                End If
                counter = 0
                prevstr = str
            End If
            counter += 1
        Next
        If counter < maxcount Then
            counter = 0
        ElseIf counter = maxcount Then
            returnlist.Add(prevstr)
        ElseIf counter > maxcount Then
            maxcount = counter
            returnlist.Clear()
            returnlist.Add(prevstr)
        End If
        prevstr = hogehoge(hogehoge.Length - 1)

        Return returnlist
    End Function

End Module
