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)
            If ans = "" Then
                Exit For
            End If
            Console.WriteLine(ans)

        Next



    End Sub


    Private Function check(ByVal hogehoge As String()) As String()
        Dim templist(999) As String
        Dim countkazu As Integer = 0

        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
                ElseIf counter = maxcount Then
                    templist(countkazu) = prevstr
                    countkazu += 1
                ElseIf counter > maxcount Then
                    maxcount = counter
                    clearstrary(templist)
                    templist(0) = prevstr
                End If
                prevstr = str
                counter = 0
            End If
            counter += 1
        Next
        If counter < maxcount Then
            counter = 0
        ElseIf counter = maxcount Then
            templist(countkazu) = prevstr
        ElseIf counter > maxcount Then
            maxcount = counter
            clearstrary(templist)
            templist(0) = prevstr
        End If

        Return templist
    End Function


    Private Sub clearstrary(ByRef ary As String())
        For i As Integer = 0 To ary.Length - 1
            ary(i) = ""
        Next
    End Sub

End Module
