Imports System
Imports System.Collections

Module Program
    Sub Main(args As String())
        Dim N As Long = Console.ReadLine()

        Dim i As Long = 0
        Dim strS As String = ""
        Dim ht As Hashtable = New Hashtable
        Dim maxCount As Long = 0
        Dim ansCount As Long = 0
        For i = 1 To N
            strS = Console.ReadLine()
            If IsNumeric(ht(strS)) Then
                ht(strS) += 1
            Else
                ht(strS) = 1
            End If
            If ht(strS) > maxCount Then
                maxCount = ht(strS)
            End If
        Next

        Dim ans As ArrayList = New ArrayList()
        For Each strS In ht.Keys
            If ht(strS) = maxCount Then
                ans.Add(strS)
            End If
        Next
        ans.Sort()
        For i = 0 To ans.Count - 1
            Console.WriteLine(ans(i))
        Next
    End Sub
End Module
