Module C
    Sub Main(ByVal args() As String)
      dim n as integer = integer.parse(console.readline())
    	dim arr(n -1) as string
    	dim i as integer
      for i=0 to n-1
      	arr(i)=console.readline()
      next
      array.sort(arr)
      dim idx(),cnt() as integer
      dim bkup as string = ""
      dim j,maxcnt as integer
      j=0:maxcnt=0
      for i=0 to n-1
          if bkup<>arr(i) then
        	j+=1
    		redim preserve idx(j)
    		redim preserve cnt(j) 
            bkup=arr(i)
            idx(j) = i
            cnt(j) = 0
          end if
          cnt(j) += 1
          if maxcnt < cnt(j) then maxcnt = cnt(j)
      next
      for i=0 to cnt.length-1
          if cnt(i) = maxcnt then console.writeline(arr(idx(i)))
      next
    End Sub
End Module