Imports System.Collections.Generic
Imports System
Module C
    Sub Main(ByVal args() As String)
        Dim s As String
        Dim n, i, maxcnt As Integer
        Dim list As List(Of String)
        Dim item As String
        Dim dict As New Dictionary(Of String, Integer)
        Dim kvp As KeyValuePair(Of String, Integer)
        n = Integer.Parse(Console.ReadLine())
        maxcnt = 0
        For i = 1 To n
            s = Console.ReadLine()
            If dict.ContainsKey(s) Then
                dict(s) += 1
            Else
                dict.Add(s, 1)
            End If
            maxcnt = Math.Max(maxcnt, dict(s))
        Next
        If maxcnt > 1 Then
            List = New List(Of String)
            For Each kvp In dict
                If kvp.Value = maxcnt Then list.Add(kvp.Key)
            Next
        Else
            List = New List(Of String)(dict.Keys)
        End If
        list.Sort(StringComparer.OrdinalIgnoreCase)
        For Each item In List
            Console.WriteLine(item)
        Next
    End Sub
End Module