Imports System

Public Class Program


    Public Shared Sub Main(args As String())

        Dim N As Integer = Integer.Parse(Console.ReadLine())

        Dim Input(N - 1) As String

        For i As Integer = 0 To N - 1
            Input(i) = Console.ReadLine

        Next

        Array.Sort(Input)


        Dim prevtext As String = ""
        Dim maxcount As Integer = 0
        Dim nowcount As Integer = 0
        Dim maxtext As String = ""


        For i As Integer = 0 To N - 1

            If prevtext = Input(i) Then
                nowcount += 1
            Else
                nowcount = 1
            End If

            If nowcount = maxcount Then
                maxtext = String.Format("{0},{1}", maxtext, Input(i))

            End If

            If nowcount > maxcount Then
                maxtext = Input(i)
                maxcount = nowcount
            End If

            prevtext = Input(i)


        Next


        For Each m As String In maxtext.Split(",")
            Console.WriteLine(m)
        Next



    End Sub



End Class
