






"""simple docstring"""


from __future__ import annotations


class    snake_case						:


   '''simple docstring'''

   def __init__(      self					:	Any,			_lowerCamelCase					:	int    ):

     '''simple docstring'''
     __A		     =					data
     __A		     =					None





class    snake_case						:


   '''simple docstring'''

   def __init__(      self					:	Optional[Any]    ):

     '''simple docstring'''
     __A		     =					None


   def 							_SCREAMING_SNAKE_CASE							(      self					:	Tuple,			_lowerCamelCase					:	int    ):

     '''simple docstring'''
     __A		     =					Node(_lowerCamelCase    )
     __A		     =					self.head
     __A		     =					new_node
     return self.head.data






   def 							_SCREAMING_SNAKE_CASE							(      self					:	str    ):

     '''simple docstring'''
     __A		     =					self.head
     __A		     =					self.head
     if self.head:
       while fast_pointer and fast_pointer.next:
         __A		     =					fast_pointer.next.next
         __A		     =					slow_pointer.next
       return slow_pointer.data
     else:
       print('''No element found.'''    )
       return None


if __name__ == "__main__":
       lowercase_								=	LinkedList()
       for _ in range(int(input().strip())):
              lowercase_								=	int(input().strip())
              link.push(data)
       print(link.middle_element())








from collections import Counter
from functools import total_ordering

from data_structures.heap.heap import Heap



@total_ordering
class 							lowercase__:






      '''simple docstring'''







      def __init__(		self   ,			__SCREAMING_SNAKE_CASE   ,			__SCREAMING_SNAKE_CASE)					->						None:







         """simple docstring"""







         UpperCamelCase__ :			Optional[int] 						=word
         UpperCamelCase__ :			Dict 						=count




      def __eq__(		self   ,			__SCREAMING_SNAKE_CASE)					->						bool:







         """simple docstring"""







         if not isinstance(__SCREAMING_SNAKE_CASE   ,			__SCREAMING_SNAKE_CASE):
            return NotImplemented
         return self.count == other.count




      def __lt__(		self   ,			__SCREAMING_SNAKE_CASE)					->						bool:







         """simple docstring"""







         if not isinstance(__SCREAMING_SNAKE_CASE   ,			__SCREAMING_SNAKE_CASE):
            return NotImplemented
         return self.count < other.count




def 	_lowerCamelCase  (		A_  :	list[str]							,  A_  :	int      )			->			list[str]:

   '''simple docstring'''






   UpperCamelCase__ :			Heap[WordCount] 						=Heap()
   UpperCamelCase__ :			Any 						=Counter(A_      )
   heap.build_max_heap(
       [WordCount(A_							,  A_      ) for word, count in count_by_word.items()]      )
   return [heap.extract_max().word for _ in range(min(A_							,  len(A_      )      )      )]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

