
'''simple docstring'''

from __future__ import annotations

from collections import Counter







def __A  (    lowerCAmelCase_       ):
     _UpperCAmelCase					:  Tuple         =    [True] * n
     _UpperCAmelCase					:  int         =    False
     _UpperCAmelCase					:  Any         =    False
     _UpperCAmelCase					:  List[str]         =    True

     for i in range(3 ,       int(n**0.5 + 1       ) ,       2       ):
          _UpperCAmelCase					:  Dict         =    i * 2
          while index < n:
               _UpperCAmelCase					:  List[Any]         =    False
               _UpperCAmelCase					:  List[Any]         =    index + i

     _UpperCAmelCase					:  List[str]         =    [2]

     for i in range(3 ,       lowerCAmelCase_ ,       2       ):
          if is_prime[i]:
               primes.append(lowerCAmelCase_       )

     return primes







def __A  (    lowerCAmelCase_       ):
     _UpperCAmelCase					:  Tuple         =    str(lowerCAmelCase_       )
     _UpperCAmelCase					:  Tuple         =    []
     _UpperCAmelCase					:  Optional[Any]         =    ["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

     for duplicate in Counter(lowerCAmelCase_       ) - Counter(set(lowerCAmelCase_       )       ):
          _UpperCAmelCase					:  Optional[int]         =    [int(number_str.replace(lowerCAmelCase_ ,       lowerCAmelCase_       )       ) for digit in digits]
          replacements.append(lowerCAmelCase_       )

     return replacements







def __A  (    lowerCAmelCase_ = 8       ):
     _UpperCAmelCase					:  int         =    set()

     # Filter primes with less than 3 replaceable digits
     _UpperCAmelCase					:  int         =    {
         x for x in set(prime_sieve(100_0000       )       ) if len(str(lowerCAmelCase_       )       ) - len(set(str(lowerCAmelCase_       )       )       ) >= 3
     }

     for prime in primes:
          if prime in numbers_checked:
               continue

          _UpperCAmelCase					:  List[str]         =    digit_replacements(lowerCAmelCase_       )

          for family in replacements:
               numbers_checked.update(lowerCAmelCase_       )
               _UpperCAmelCase					:  int         =    primes.intersection(lowerCAmelCase_       )

               if len(lowerCAmelCase_       ) != family_length:
                    continue

               return min(lowerCAmelCase_       )

     return -1


if __name__ == "__main__":
   print(solution())






from __future__ import annotations


class        A_					:




      '''simple docstring'''


      def __init__(				self:       Union[str, Any]						,      a:       int				):
       __lowerCamelCase		:							List[Any]							=						data
       __lowerCamelCase		:							Optional[Any]							=						None



class        A_					:




      '''simple docstring'''


      def __init__(				self:       Dict				):
       __lowerCamelCase		:							Dict							=						None




      def      _snake_case	(				self:       Dict						,      a:       int				):
       __lowerCamelCase		:							List[Any]							=						Node(a				)
       __lowerCamelCase		:							Dict							=						self.head
       __lowerCamelCase		:							Optional[int]							=						new_node
       return self.head.data




      def      _snake_case	(				self:       Optional[Any]				):
       __lowerCamelCase		:							Union[str, Any]							=						self.head
       __lowerCamelCase		:							List[Any]							=						self.head
       if self.head:
        while fast_pointer and fast_pointer.next:
         __lowerCamelCase		:							Any							=						fast_pointer.next.next
         __lowerCamelCase		:							str							=						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())

