


lowercase_           =	{
    '0': 1,
    '1': 1,
    '2': 2,
    '3': 6,
    '4': 2_4,
    '5': 1_2_0,
    '6': 7_2_0,
    '7': 5_0_4_0,
    '8': 4_0_3_2_0,
    '9': 3_6_2_8_8_0,
}

lowercase_           =	{1_4_5: 1_4_5}

lowercase_           =	{
    1_4_5: 0,
    1_6_9: 3,
    3_6_3_0_1: 3,
    1_4_5_4: 3,
    8_7_1: 2,
    4_5_3_6_1: 2,
    8_7_2: 2,
}
def       UpperCamelCase__     (  SCREAMING_SNAKE_CASE__						):
 if n in CACHE_SUM_DIGIT_FACTORIALS:
  return CACHE_SUM_DIGIT_FACTORIALS[n]
 __lowerCamelCase		:							List[Any]							=						sum(DIGIT_FACTORIALS[let] for let in str(SCREAMING_SNAKE_CASE__						)						)
 __lowerCamelCase		:							List[str]							=						ret
 return ret
def       UpperCamelCase__     (  SCREAMING_SNAKE_CASE__			,       SCREAMING_SNAKE_CASE__ = None						):
 __lowerCamelCase		:							Optional[Any]							=						previous or set()
 if n in CHAIN_LENGTH_CACHE:
  return CHAIN_LENGTH_CACHE[n]
 __lowerCamelCase		:							str							=						sum_digit_factorials(SCREAMING_SNAKE_CASE__						)
 if next_number in previous:
  __lowerCamelCase		:							Any							=						0
  return 0
 else:
  previous.add(SCREAMING_SNAKE_CASE__						)
  __lowerCamelCase		:							List[Any]							=						1 + chain_length(SCREAMING_SNAKE_CASE__			,       SCREAMING_SNAKE_CASE__						)
  __lowerCamelCase		:							Tuple							=						ret
  return ret
def       UpperCamelCase__     (  SCREAMING_SNAKE_CASE__ = 60			,       SCREAMING_SNAKE_CASE__ = 1_000_000						):
 return sum(1 for i in range(1			,       SCREAMING_SNAKE_CASE__						) if chain_length(SCREAMING_SNAKE_CASE__						) == num_terms						)


if __name__ == "__main__":
       print(F"""{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())

