Imports System.Collections.Generic
Imports System
Module C
    Sub Main(ByVal args() As String)
        Dim n As Integer = Integer.Parse(Console.ReadLine())
        Dim arr(n - 1) As String
        Dim i, maxcnt As Integer
        maxcnt = 0
        For i = 0 To n - 1
            arr(i) = Console.ReadLine()
    	Next
  		array.sort(arr)
  		Dim dict As New Dictionary(Of String, Integer)
  		For i = 0 To n - 1
            If dict.ContainsKey(arr(i)) Then
              dict(arr(i)) += 1
            Else
              dict.Add(arr(i), 1)
            End If
  			If maxcnt < dict(arr(i)) Then maxcnt = dict(arr(i))
		next
  		dim list as new list(of string)
        Dim kvp As KeyValuePair(Of String, Integer)
        For Each kvp In dict
        	If kvp.Value = maxcnt Then list.Add(kvp.Key)
        Next
  		list.Sort()
  		Dim item As String
        For Each item In list
            Console.WriteLine(item)
        Next
    End Sub
End Module