Imports System
Imports System.Collections.Generic

Class C
	Shared Sub Main
		Dim dataNum As Integer
		Dim input As String
		Dim dict As New Dictionary(Of String,Integer)
		
		input = Console.ReadLine()
		dataNum = Integer.Parse(input)
		For i As Integer = 1 To dataNum
			input = Console.ReadLine()
			
			If dict.ContainsKey(input)
				dict(input) += 1
			Else
				dict.Add(input,1)
			End If
		Next
		'
		Dim maxvalue As Integer = 0
		For Each v As Integer In dict.Values
			If maxvalue < v
				maxvalue = v
			End If
		Next

		Dim anslist As New List(Of String)
		For Each kvp As KeyValuePair(Of String,Integer) In dict
			If kvp.Value = maxvalue
				anslist.Add( kvp.Key )
			End If
		Next
		
		anslist.Sort()
		For Each ans As String In anslist
			Console.WriteLine( ans )
		Next
		
	End Sub
End Class