




"""simple docstring"""


def  UpperCAmelCase__	(snake_case__							: List[Any]   ):
  """simple docstring"""

  if not head:
    return True
  # split the list to two parts
  _snake_case							:		Tuple								=  head.next, head
  while fast and fast.next:
    _snake_case							:		Dict								=  fast.next.next
    _snake_case							:		List[Any]								=  slow.next
  _snake_case							:		Optional[int]								=  slow.next
  _snake_case							:		List[str]								=  None  # Don't forget here! But forget still works!
  # reverse the second part
  _snake_case							:		Optional[Any]								=  None
  while second:
    _snake_case							:		str								=  second.next
    _snake_case							:		List[str]								=  node
    _snake_case							:		Union[str, Any]								=  second
    _snake_case							:		Tuple								=  nxt
  # compare two parts
  # second part has the same or one less node
  while node:
    if node.val != head.val:
      return False
    _snake_case							:		Dict								=  node.next
    _snake_case							:		Union[str, Any]								=  head.next
  return True


def  UpperCAmelCase__	(snake_case__							: Optional[Any]   ):
  """simple docstring"""

  if not head or not head.next:
    return True

  # 1. Get the midpoint (slow)
  _snake_case							:		Tuple								=  head
  while fast and fast.next:
    _snake_case							:		Any								=  fast.next.next, slow.next

  # 2. Push the second half into the stack
  _snake_case							:		str								=  [slow.val]
  while slow.next:
    _snake_case							:		int								=  slow.next
    stack.append(slow.val   )

  # 3. Comparison
  while stack:
    if stack.pop() != cur.val:
      return False
    _snake_case							:		Tuple								=  cur.next

  return True






def  UpperCAmelCase__	(snake_case__							: int   ):
  """simple docstring"""

  if not head or not head.next:
    return True
  _snake_case							:		Union[str, Any]								=  {}
  _snake_case							:		int								=  0
  while head:
    if head.val in d:
      d[head.val].append(snake_case__   )
    else:
      _snake_case							:		List[Any]								=  [pos]
    _snake_case							:		Any								=  head.next
    pos += 1
  _snake_case							:		List[Any]								=  pos - 1
  _snake_case							:		Dict								=  0
  for v in d.values():
    if len(snake_case__   ) % 2 != 0:
      middle += 1
    else:
      _snake_case							:		int								=  0
      for i in range(0		,       len(snake_case__   )   ):
        if v[i] + v[len(snake_case__   ) - 1 - step] != checksum:
          return False
        step += 1
    if middle > 1:
      return False
  return True








"""simple docstring"""


def  UpperCAmelCase__	(snake_case__							: int = 10_00   ):
  """simple docstring"""

  _snake_case		, _snake_case							:		List[Any]								=  1, 1
  _snake_case							:		str								=  []
  for i in range(1		,       n + 1   ):
    _snake_case							:		Any								=  prev_numerator + 2 * prev_denominator
    _snake_case							:		Optional[Any]								=  prev_numerator + prev_denominator
    if len(str(snake_case__   )   ) > len(str(snake_case__   )   ):
      result.append(snake_case__   )
    _snake_case							:		int								=  numerator
    _snake_case							:		Any								=  denominator

  return len(snake_case__   )


if __name__ == "__main__":
     print(F'''{solution() = }''')


