      module charaSort
      implicit none
      
      contains
      recursive function sort( s ) result( r )
        implicit none
        character(10),intent(in) :: s(:)
        character(10) :: r( size(s) )
        
        if( size(s)>1 )then
          r = [sort( pack(s, s<s(1)) ), &
               pack(s,s==s(1)), &
               sort( pack(s, s>s(1)) )]
        else
          r = s
        end if
      end function
      end module


      PROGRAM Poll
      use charaSort
      IMPLICIT NONE
      integer(16) :: n
      character(10),allocatable :: s(:)
      character(10),allocatable :: note1(:)
      integer(16) :: i,counter
      integer(16),allocatable :: note2(:)
      logical,allocatable :: flag(:)
      
      
      read*,n
      allocate( s(1:n) )
      allocate(note1(n),note2(n),flag(n))
      do i = 1,n
        read'(a)',s(i)
      end do
      
      s = sort(s)
      
      counter = 1
      note1(1) = s(1)
      note2(:) = 0
      do i = 2,n
        if(note1(counter)==s(i))then
          note2(counter) = note2(counter) + 1
        else
          counter = counter + 1
          note1(counter) = s(i)
        end if
      end do
      
      flag = note2==maxval(note2)
      
      do i = 1,counter
        if(flag(i))then
          print'(A)',note1(i)
        end if
      end do
      
      END PROGRAM